Skip to content
masterclass Buddy

Linux & Shell · Command

cd

cd changes the current shell's working directory. It supports logical or physical handling of .., uses HOME or OLDPWD for special cases, and returns a nonzero status on error.

Last updated

Syntax

cd [ -L|-P ] [ directory ]
cd -

In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.

Subscribe
  • pwd
  • HOME
  • OLDPWD
  • PWD
  • CDPATH
  • chdir

Source: cd(1p) - Linux manual page. Checked 2026-11-03.