Back to Blog
Arnošt Havelka

Directory Navigation in Bash

Master the cd command to move around your file system.

Start Interactive Lesson
Directory Navigation in Bash

Now that you know where you are and what's around you, it's time to move. The cd command is your passport to navigate through directories.

Moving Between Directories

The cd command (change directory) is how you explore your file system. You can jump to any directory with a single command.

Try the command

Try moving to a new directory. What directory will you explore?

Build the command
cd[directory]
cdChange Directory - moves you to a different location in the file system.
Terminal
C:\Users\User>cd [directory]

Real-World Examples

Navigate to a specific directory:

Command Prompt
/home/user
C:\Users\User>pwd

Going Back: Parent Directory

Need to go back? Use cd .. to move up one level to the parent directory.

Try the command

Go back one level!

Build the command
cd..
..Parent Directory - takes you one level up in the directory tree.
Terminal
C:\Users\User>cd ..

Climb back up:

Command Prompt
/home/user/Documents
C:\Users\User>pwd

Quick Navigation to /tmp

The /tmp directory is perfect for temporary files. Jump there instantly with cd /tmp.

Command Prompt
/home/user
C:\Users\User>pwd

Understanding Paths


Knowledge Check

1 / 3

What does cd stand for?

References

These documentation links provide authoritative details for the commands used in this article.

Up Next

PWD - Print Working Directory

Find your current directory before running file commands