Menu
Coddy logo textTech

Change Directory

Part of the Fundamentals section of Coddy's Terminal journey — lesson 6 of 82.

The cd command stands for Change Directory. It lets you navigate from one folder to another in the filesystem.

To move into a folder, type cd followed by the folder name:

cd documents

After running this, you are now inside the documents folder. You can confirm this with pwd:

/home/documents

Useful ways to use cd:

cd .. — move up one level to the parent directory:

cd ..

cd ~ — go directly to your home directory from anywhere:

cd ~

cd / — go to the root directory, the very top of the filesystem:

cd /

cd - — go back to the previous directory you were in:

cd -

Tip: You can combine cd with ls and pwd to explore your filesystem confidently — list what's there, move into it, and confirm where you are.

challenge icon

Challenge

Beginner

Navigate into the documents folder using the cd command, then print your current location using pwd.

Hint: You can run multiple commands one after another — first cd, then pwd.

Cheat sheet

The cd command stands for Change Directory and is used to navigate between folders in the filesystem.

To move into a folder:

cd documents

Common cd shortcuts:

cd .. — move up one level to the parent directory

cd ~ — go to your home directory

cd / — go to the root directory

cd - — return to the previous directory

Tip: Combine cd with ls and pwd to navigate effectively — list contents, change directories, and confirm your location.

Try it yourself

Terminal
quiz iconTest yourself

This lesson includes a short quiz. Start the lesson to answer it and track your progress.

All lessons in Fundamentals