Unix Directories

The UNIX directory structure pertains to the computer as a whole: not just to a single disk drive. It starts with the root directory which is on the first disk drive. However, other disk drives start at what are called mount points which can be equated to any sub-directory. One of the directories within the root is called usr (or sometimes home). It contains a sub-directory for each user, eg:

Each user's home directory contains at least one sub-directory for his incoming email, one for his document files, one for temporary files and one for his executable files (programs). There will be others.

When you log in, UNIX automatically puts you in your home directory. You can create, edit or delete any file or sub-directories within your home directory or any of its sub-directories. But you cannot do so in anybody else's home directory without their permission.

cd transfers you to your home directory
cd mail transfer you to your mail directory
cd .. transfer to the parent of the current directory
pwd displays the current working directory
mkdir source make sub-directory called source in current directory
rmdir source kill the source directory within current directory
ls list contents of current directory
ls source list the files in the source directory
ls .. list the contents of the current directory's parent
mv dir1 dir2 if dir2 does not exist, renames dir1 to dir2, but if it does, creates dir1 as a sub-directory of dir2

This page's parent within this Web Site. About this Web Site. Its home page. Email its Author.