In order to make the most of your Unix system it is important to know a little about the Unix file system.
The image below shows a typical Unix file system.
The key to Files System (FS) navigation is pathnames. There are 2 types of pathname; Absoloute and Relative.
An Absolote pathname specifies the entire pathname all the way from the top of the tree ' / ' (root).
A Relative pathname specifies the file from the pwd (present working directory).
For example, in relation to figure 1 above, if your current pwd is /home/a/agordon and you need to access the index.html file, the
Absoloute pathname would be /home/a/agordon/public_html/index.html; where the relative pathname would be public_html/index.html.
An easy way to distinguish between the 2 is a relative pathname will never begin with a /
CHANGING DIRECTORIES
Changing directories in Unix is a very simple procedure and is done using the cd Command.
The cd command, like all other Unix commands, accepts both absoloute and relative pathnames.
The Command format is simply cd directory_name.
For example, to access the games directory from the pwd mentioned previously, using a relative pathname simply type 'cd games'.
If you use the cd command without entering a directory name you will return to your home directory.
USING THE ls COMMAND
The ls command is used to display a list of all files and directories within specified directories.
An easy way to describe this command is an advanced version of the dir command in DOS machines.
The Command format is ls [option(s)] [pathname(s)]
There are many options, known as switches which can be added into the command. For example:
ls - a ....to display hidden files.
ls - F ....to display file types.
ls - l ....to display long list.
ls - ld ....to list individual directories.
ls - R ....to display a recursive listing.