Directory - change the current working Folder.
cd [-L|-P] [dir]
-P Use the physical directory structure instead of following symbolic links
(see also the -P option to the set builtin command)
-L Force symbolic links to be followed
a dir is
given, changes the shell's working directory to name. If not, changes to HOME.
cd - will go back to the
last folder you looked at. (Previous directory - equivalent to $OLDPWD)
shell variable CDPATH provides a useful feature, this variable is similar to
PATH but it sets up a list of paths where cd will
search for subdirectories. CDPATH may be set on the command line for use in the
current session, or in .bash_profile for
permanent use, the list of paths must be colon separated (:)
If dir begins
with a slash (/), then CDPATH is not used.
a non-empty directory name from CDPATH is used, or if - is the first argument,
and the directory change is successful, the absolute pathname of the new working
directory is written to the standard output.
return value is true if the directory was successfully changed; false otherwise.
Move to a subfolder named "Documents"
move to the fonts folder
Change to another folder
Move up to the parent directory (/Users/kate/)
To move up two levels:
Move to the top of the boot volume
Move to your home directory
Move to a folder when the folder name includes spaces, parentheses or any other
cd 'AppleWorks User Data'