UNIX File Structure
Logically, UNIX is structured like a tree. The top level directory is called root and
is represented by /. Under the root are several directories. Some of the more important
ones are:
home usr var tmp
Everyone's home directory is located under home. Most UNIX applications are located
under usr. Everyone's mail spool is located under var. You can temporarily store
files under tmp.
Moving Around
You can change to a directory by specifying the full path starting at root. Some
examples:
cd /
cd /tmp
cd /var/mail
cd /usr/usc/bin
You can change to a user's home directory by using the ~ symbol followed by a username.
Some examples:
cd ~ttrojan
cd ~jsmith
cd ~pdp101/assignments
cd ~csci102/programs/prog1
You can change to a subdirectory of the current directory by typing the subdirectory name. Some examples assuming you
are in a directory called fruits which contains subdirectories named apple, banana and orange:
cd banana
cd orange
cd apple/green
You can move up one directory from the current directory by typing ..
which stands for the parent directory. For example:
cd ..
At any point in time, you can return to your home directory by simply typing cd with no
arguments. For example:
cd
For more info on using cp and other directory commands, see the ITS documentation at
Directory Commands.
Last updated:
February 03, 2011