Linux and Unix cd command

Quick links

About cd
Syntax
Examples
Related commands
Related Q&A
Linux and Unix main page

About cd

Changes the shell's working directory.

Syntax

cd [-L|-P] directory

Options

-L Force symbolic links to be followed.
-P Use the physical directory structure without following symbolic links.

Examples

cd hope

The above example would change the working directory to the hope subdirectory if it exists.

cd ../home/users/computerhope

The above example would traverse up directory and then down into the home/users/computerhope subdirectory.

cd ../../

Traverse two directories up the directory tree.

Related commands

pwd
chdir

Related Q&A