The UNIX File System

The following is a sample of a UNIX path:

/usr/home/login_name
In the above path the first forward slash (/) is the top level directory called the "root" directory. The usr directory is a subdirectory of the root directory, home is a subdirectory of usr, and login_name is a subdirectory of home. If your login name were "bob", then bob would appear in the place of login_name. Each "/" after the root directory is just a separator.

To change to a directory you use the cd (change directory) command. You can cd to a directory by typing the absolute path, meaning that the entire path starting from root is typed out like the above sample, or you can specify a relative path:

% cd tmp
The above command uses a relative path to change to a subdirectory of the current directory.

The cd command is easy to master after a little practice. The chart below shows what happens when you type cd alone or with various arguments. Try of few of these cd examples and then type pwd (Print Working Directory) to see which directory you are currently in.

Back