[Next] [Previous] [Up] [Top] [Contents]

3.6 Directory Navigation and Control

3.6.2 cd - change directory

You can change to a new directory with the cd, change directory, command. cd will accept both absolute and relative path names.

Syntax

cd [directory]

Examples

cd (also chdir in some shells) change directory

cd changes to user's home directory

cd / changes directory to the system's root

cd .. goes up one directory level

cd ../.. goes up two directory levels

cd /full/path/name/from/root changes directory to absolute path named (note the leading slash)

cd path/from/current/location changes directory to path relative to current location (no leading slash)

cd ~username/directory changes directory to the named username's indicated directory (Note: the ~ is not valid in the Bourne shell; see Chapter 5.)


Introduction to Unix - 14 AUG 1996
[Next] [Previous] [Up] [Top] [Contents]