|
Unix Tutorial 1.1: Command Summary I: Basic Commands |
| Print |
|
|
IMPORTANT: Upper and lower case letters are
DISTINCT to the Unix system. Your login id, password, and all commands
must be entered in the correct case or they will not work. LS is not
ls, for example.
The basic prompt is the
machine's name, and a %; your prompt may be longer and contain your
account name. When the prompt has appeared on the screen, you may enter
commands. Each command is the command word plus any options. Command
options often begin with a - sign (e.g. ls -l, ps -ax). Each command line must be terminated with a <RETURN>.
Logging on
login: user_name
password: password
Logging off
| % exit or |
(You will not be allowed to logout the first time, if you have stopped jobs. You can either kill these jobs or logout again.) |
| % CTRL-D |
| |
Changing your password
| % passwd |
| Old password: oldpassword |
| New password: newpassword |
(new password - 6 characters minimum) |
| Verification: newpassword |
Getting on-line help
|
|
|
|
| % man man |
Information about using man |
| % apropos command |
Show which manual pages refer to command |
| |
|
Seeing what files you have (directory listing)
| % ls |
To see file names in current directory. |
| % ls -l |
To see a long listing of file information. |
| % ls *.c |
To see all file names ending in ".c". |
| % ls -a |
To see file names including those beginning with ".". |
Managing your jobs
| % ps |
See what jobs (PIDs) you have running. |
| % kill %154 |
Permanently end job 154.[ Find job number with jobs]. |
| % kill -9 %76 |
-9 is slightly more deadly. |
| % CTRL-Z |
Stop the job which is already running. |
| % bg %54 |
Resume job 54, (which was stopped) in the background. |
| % fg %154 |
Resume job 154 in the foreground |
| % command & |
Start a program or command running in the background. |
Making a new directory
| % mkdir newdir |
Make new subdirectory of the current working Directory. |
Changing to a different directory
| % cd otherdir |
Go to a different directory. |
| % cd otherdir/subdir |
Go to a different directory and subdirectory. |
| % cd .. |
Go to directory above this one. |
| % cd ~/subdir |
Go to subdirectory of home directory. |
Removing a subdirectory
| % rmdir subdir |
The directory can't be removed unless it is empty. |
Deleting a file
| % rm byefile |
Remove the link to the file under this name; when all links are removed, the file is physically removed. CAUTION: rm * removes all files in the content directory. So may rm * .c. Once deleted, the file is GONE. If not aliased by default, you can use rm -i instead, or put the line alias rm rm -i in your .cshrc file. |
|