February 2001
Beginner to intermediate
448 pages
9h 2m
English
Official Description
Changes the current working directory.
Syntax
cd [directory]
Options
None
Oddities
C shell cd command is slightly different.
You must have execute (search) permission in the specified directory to cd to it.
If - is specified as the directory, the cd command changes your current (working) directory to the directory name saved in the environment variable OLDPWD.
Example
$ cd /tmp $ $ print $OLDPWD # Previous directory is held in OLDPWD /home/obrien $ $ cd /etc $ $ print $OLDPWD /tmp $ $ pwd /etc $ $ cd - # Uses contents of OLDPWD /tmp $ $ pwd /tmp $ $ cd # Uses contents of $HOME $ $ pwd /home/obrien $
Read now
Unlock full access