The most important command for moving around in the Linux environment is the
cd (“change directory”) command.
As always, you can find out more information about the
cd command by reading the man pages:
To return to your UNIX home directory, use the “~” (tilde):
Or to go to someone else’s home directory add his/her username after the “~” (tilde) sign:
Note: You must have execute permission on a directory in order to
cd to it (then you will need read permission in order to list (
ls) the files in that directory).
Also note: The “/” (forward slash) is used in the path name to separate directory names. So, you do not have to change one directory at a time:
In the case above, the directory, called “directoryname“, is in the directory where you are currently located. If you need to get outside of your current directory, there are a few ways to do this:
In the example above, you are going up one level.
In the example above, you are going up one level then over to the directory, “adir“, and the sub-directory, “bdir“.
Note the initial “/” (forward slash). In the example above, you are going to the root (top level) of the filesystem and then going to the directory, “adir“, and then the sub-directory, “bdir“.
Read the man pages for more information:
To find out what directory you are currently in, use the
pwd (“print working directory”) command:
Continue to Lesson 4 – Viewing/Searching for Files
Return to index of lessons.
Last revised May 9, 2003.