Changing Directories Using the cd Command

Use the cd directory_name to change to a new current directory. The cd command accepts both absolute and relative pathnames.

Command Format

cd directory_name

Examples

In this example, the cd command is followed by an absolute pathname. Using this command you would be placed in the home directory which is a sub-directory of the / (root):

$ cd /home
$

In the next example we use a relative pathname to change the current working directory to the chuck directory which is a sub-directory of the current working directory:

$ cd chuck
$

Use the cd command without a directory name to change to your home directory:

$ cd
$

Note: cd ~ also changes you to the home directory.