A Summary of Minimal UNIX Commands - Fall '02

Dr. Kris Stewart (stewart@rohan.sdsu.edu)
San Diego State Univeristy

Remember - the computer is your friend, but it is not too smart and will do EXACTLY what you tell it, not what you meant!

Be wary of "info overload" - set bookmarks with netscape (or lynx)

Try to get into the habit and reading the screen when you first log onto rohan. This gives valuable system information, such as scheduled down times and changes to software.

All commands below are to be typed from the Unix command line.

If you get the message - Terminal Type Unknown You need to type set term=vt100 right away if this is the terminal type your software is emulating.

If your screen lines start to look "messed up" type resize

If your backspace key doesn't work - type stty erase your-favorite-single-key-stroke-here

SDSU's rohan machine is a Sun Sparc Station 10.

Useful Unix commands
(a directory = a folder and Unix is case-sensitive):

xterm&
Open a new xterm window (when in BA113/110)
ls
list contents of current directory
mkdir dir
create a subdirectory named 'dir'
rmdir dir
remove the subdirectory name 'dir' (the subdirectory must be empty first)
cd dir1
change to subdirectory dir1 (contained in current directory)
cd ..
change to 'parent' directory
pwd
print working directory (Where am I?)
head filename
display the first few lines of a file
more filename
display contents of filename, screen by screen
mv file1 file2
move (rename) contents of file1 into file2
cp file1 file2
copy the contents of file1 into file2
rm file
remove (delete) the 'file'
ctrl-u (press Ctrl-key & the letter u at same time)
erase current line
ctrl-c
terminates (kills) current job
ctrl-s
temporarily halts the listing on screen
ctrl-q
continued the halted listing
quota -v
display current file storage used (in Kbytes)
du
gives directory structure and amount of space used
gzip filename
reduces size and replaces by filename.gz
gunzip filename.gz
undoes "gzip" so you can read filename again
tar cf mytar.tar *
(c)reate archive file, mytar.tar, containing everything in current dir and recursively all files in subdirs
tar xf mytar.tar
e(x)tract from the archive (keeps dir structure)
tar tf mytar.tar
(t)est the archive file mytar.tar to see contents
*** man tar *** for all the details.
There are tar utilities that run on Macintosh and PC also.
THESE FILES MUST BE DOWNLOADED AS BINARY.

return to CS575 Home Page