UNIX QUICK REFERENCE
Directory tree from my home directory:
/home/usra/64/25640
essay_dec05.doc, naep.lst, naep.sas
/mail
mailfile1, mailfile2, ...
/workfiles
file1, file2, ...
/public_html
index.html, anotherwebpage.html, myphoto.gif, ...
/proj1
index.html, map1a.gif, map1b.gif, ...
/proj2
index.html, map2a.gif, map2b.gif, ...
Detailed listing of my home directory:
-rw-r--r-- 1 johnmack 0419 27648 Dec 11 2005 essay_dec05.doc
drwx------ 2 johnmack 3896 4096 Apr 13 1998 mail
-rw------- 1 johnmack 0419 1610 Sep 25 11:52 naep.lst
-rw-r--r-- 1 johnmack 0419 1677 Sep 25 11:52 naep.sas
drwxr-xr-x 4 johnmack 3896 4096 Sep 5 12:38 public_html
drwx------ 1 johnmack 0419 4096 Mar 27 2000 workfiles
first 10 characters in detailed listing
1 - file, d directory
2-4 read/write/execute permissions for file owner, - not permitted
5-7 rwx permissions for UNIX group, - not permitted
8-10 rwx permissions for other users, - not permitted
BASIC COMMANDS
Command Description
pwd echo current directory path
cd change to home directory
cd .. change to parent of current directory
cd subdir change to subdirectory subdir
ls list directory contents (filenames only)
ls -1 list directory contents (permissions, owner, size, when created, filename)
mkdir subdir create a new subdirectory subdir
rmdir subdir remove empty subdirectory subdir
rm file1 remove file1
mv file1 dir1 move file1 to existing subdirectory dir1
mv oldname newname rename oldname as newname
mv "my file" file2 use quotes to rename a file with spaces in the name
cp origfile copyfile copy origfile as copyfile
chmod 754 file1 change mode (set permissions) of file1
read=4 write=2 execute=1; each digit is sum of permissions:
here 7=rwx for owner; 5=r-x for group; 4=r-- for others.
quota -v display disk usage and quotas
passwd change password