UNIX Command Reference
Directory Commands:
ls Lists the contents of a directory
[options: -l (long) -a (all)]
cd Change the current directory
mkdir Make a sub-directory
rm Remove a file
[options: -r (remove a directory)]
chmod Change the permissions of a file
[permissions: see permissions below]
[options:-R (recursive)]
mv Move a file (also rename a file)
cp Copy a file
echo Display a string
cat Display contents of a file
touch Change date of/create file
Permissions:
l=link (always has permissions lrwxrwxrwx)
d=directory
r=permission to read
w=permission to write
x=permission to execute
-= no permission
Numerical representation of permissions:
7 rwx
6 rw-
5 r-x
4 r--
3 -wx
2 -w-
1 --x
Common Permissions: Look like this in ls -1
755 -rwxr-xr-x
or drwxr-xr-x (good for directories and programs)
711 drwx-x-x (only good for directories - more private than 755)
700 -rwx-----
or drwx------(good for directories and
programs - most private)
644 -rw-r--r-- (only good for files)
600 -rw------- (only good for files - most private)
Useful Programs:
man Show instructions on how to use
more View a file page by page
emacs Open a file for editing
Useful Hints:
ls -l | more Long list of current directory, pause before end
of each screenfull
cd Return to home directory
cd ~ Return to home directory
cd .. Return to previous directory
pine Mail
pwd Print current working directory
Copyright reserved to Yonah Russ and Nachum Danzig