The cd command

Change the shell working directory. 10 examples from the lessons of the IVski Linux Playground — try them in the terminal next to them.

Examples

cd documents

Go to the documents directory

cd /etc

Go to /etc (absolute path)

cd ~

Go to your home directory

cd ..

Go up one level (parent directory)

cd ../..

Go up two levels

cd -

Go back to previous directory

cd doc[TAB]  →  cd documents/
mkdir -p "$1" && cd "$1"
cd myproject
cd ~/dashboard

Lessons that use cd

Related commands