There are many general introductions to UNIX available on the web (see below
). The basic commands shown here are somewhat tailored to use on the designated machines in the designated labs; they should be sufficient for the course assignments.
When you log in to UNIX (after providing your login name and password), you may be asked for a terminal type. Type
at the terminal type, or, if you see
there, press Return. You should now see a UNIX prompt, which usually looks like
Note: The default shell (roughly, the command interpreter, or the program that takes the commands you type in and figures out what to do with them) for older users is called "csh", but you may find it easier to use other shells, like "tcsh", that have some nice features. (See section below
.) If you want to try a different shell, just type the name of it in at the prompt: typing
will run that shell, which has a
These should be typed at the prompt; after typing the command, press Return.
||cp file directory
||use "." for current directory
use ".." for parent directory
use slashes for dir. hierarchies
ex: cp myfile ../sisterdir/childdir
rm -r directory
|ex: rm file1 dir1/file2 ../dir2/file3
for recursive removing:
rm -rf dir1
||hit the spacebar to get to next page, 'b' to go back
ex: more ReadMe; more ../ReadMe
|view directory contents
||ls; ls dir
||ls views current directory;
see "man ls" for ls options
|ex: cd NoNPunctate; cd .. (move to parent directory)
cd (by itself) (move to home directory)
|print working directory
||tells you where you currently are
||lpr -Pprinter file(s)
||ex for Soda: lpr -Plw274 file1 file2
(printer in room 274)
||ssh po; (login again)|
|you will be asked to state old and new passwords
||man; man command
|provides some manual information about the command
lists commands with manual pages that make reference to this subject
||press control and C at the same time
|list current jobs
||This will give you a list of jobs (preceded by a
number in brackets), which may come in handy if you want to kill one
|kill a job
||Replace the # with the job number listed with the
|simple editor (pico)
||easy to use, commands on the screen
see "man pico" (or vi, or emacs) for further help
||The & symbol at the end causes the window to be
run in the background.
You can also get a menu of options by pressing the right or middle mouse key (in the Soda lab).
Enter tcsh by typing
at the prompt.
Note: To permanently change your shell to tcsh, so that upon logging in you will automatically be using tcsh, you can run
. You'll be asked to enter a new shell:
Old shell: /bin/csh
New shell: /usr/local/bin/tcsh
It may take a day or so for the change to take effect.
- [tab]: Complete word. When typing a file (or command) name, for
instance, you can type the first several characters and hit [tab] to
complete the word. If more than one possible completion exists, you can
type ^D to list the current possible completions.
- ^P, [up-arrow]: Copy previous command into current line. Can be used
multiple times to go progressively further back into command-line
- ^N, [down-arrow]: Move forward (more recent) in command-line history.
- ^A: Move cursor to beginning of line.
- ^E: Move cursor to end of line.
- ^F, [right-arrow]: Move cursor forward/to the right.
- ^B, [right-arrow]: Move cursor backward/to the left.
- ^D: Delete current character.
- ^K: Delete rest of line.
Some more information on the tcsh shell can be found here
Some other basic resources on the web:
... many other findable by searching on "unix basics"...