->Title Page
->Intro
->Unix
-->Overview
->File Structure
-->Online Manual
-->Basic Commands
-->Additional Commands
-->Login files
-->Special characters
-->Miscellaneous Tips
-->Things to try
->Vi editor
->Mirror sites
->Further reading

[ Up ]
[Prev][Home][Next]
[Author]

Unix --> Files and Directories

Pathnames

There are a number of methods for specifying which directory and file you are interested in. Pathnames (the directory specification) can be relative or absolute. Absolute pathnames begin with a slash, /, and start at the root directory. Successive directories down the path are also separated by a slash. In the previous paragraph I gave the absolute pathname of my home directory. Each subdirectory is a branch in the directory tree.

A relative pathname begins with the directory you are in (commonly referred to as working directory) and moves downward to a lower directory. Relative pathnames begin with the name of the first directory below the working directory. Each lower directory down the path should have a slash in front of it. Assuming I was in the /home directory, cernan/taylor would be the relative pathname to my home directory. A "." indicates the working directory, while ".." indicates the directory one level up (known as the parent directory). If I were in my home directory, the relative pathname for the /home directory would be ../.. which says go to the "grandparent" directory two directories higher than you are now.

Naming files and directories

In general, file and directory names should be composed only of letters of the alphabet, digits, "."'s, and "_"'s. Be aware that files that begin with a "." do not appear in the directory list unless a special flag has been set when doing the list command.

The period is often used to add a suffix on to a base filename. For example, the source code for C programs have a .c suffix added to them, e.g. prog.c. Separating a filename by a "." is particularly useful when using wildcard selections.

Please notify owners of webpages with outdated links to these pages

Find this site useful? Want to give something back?

© 1993-2001 Christopher C. Taylor