The Unix Tree

  • The UNIX file system consists of files and directories organized in a hierarchical structure.

  • Avoid File names and directory names with spaces and special characters

  • In the figure below, there are 5 subdirectories under the root, i.e. bin, tmp, home, use, src. The directory home has two subdirectories (i.e. iap and paolaf). Thus the parent directory of iap is home.

The system provides a few short synonyms relative to the working directory:

  • The root is denoted by a forward slash (/).

  • The home directory of any given user is specified by a tilde (~).

  • A single dot (".") indicates the current working directory.

  • A double dot ("..") indicates the directory above the current directory.

You can find out your current working directory (in other words, where you currently are in the Unix tree) by typing the command pwd (print working directory) at the prompt and then hitting return.

# print working directory  
pwd
# change directory to root directory
cd /
pwd
# change directory to home directory
cd ~
pwd
# change directory to root directory
cd /
pwd

Last updated

Was this helpful?