Linux Commands Reference - Complete Linux Command Guide

Comprehensive Linux command reference with 150+ commands. Search, filter by category, and view detailed usage examples.

Share
Back to commands

cd

Change working directory

Syntax

cd [DIRECTORY]

Common Options

~Change to home directory
-Change to previous directory
..Change to parent directory
.Current directory
/path/to/dirChange to absolute path
relative/pathChange to relative path
-PUse physical path (resolve symlinks)
-LUse logical path (follow symlinks)
-eError if directory does not exist

Common Examples

cd /var/log

Change to /var/log directory

cd ~

Change to home directory

cd -

Return to previous directory

cd ..

Change to parent directory

cd ../..

Go up two directory levels

cd -P /symlink

Resolve symlink then change

cd ~/Documents

Change to ~/Documents

cd /

Change to root directory

Related Commands

Related Tools

More Code & Dev Tools