Navigation

cd

Changes the current shell directory.

cd changes the working directory for your current shell session. It affects where relative paths point.

Syntax
cd [directory]

Arguments explained

  • directory can be absolute, relative, ~ for home, .. for parent, or - for the previous directory.

Common examples

Move into /var/log
cd /var/log

Uses an absolute path to move directly to the log directory.

Return to the previous directory
cd -

Useful when moving between two locations repeatedly.

cd Command
FieldDetails
Commandcd
CategoryNavigation
Primary useChanges the current shell directory.
Syntaxcd [directory]