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

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.

Usage:cd[directory]
cd
Change Directory - moves you to a different location in the file system.

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.

Usage:cd..
..
Parent Directory - takes you one level up in the directory tree.

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 Microsoft Learn and Windows documentation links provide authoritative details for the commands used in this article.

Up Next

Mastering ls Flags

Learn powerful ls flags to see more file details.