Cd
Jump to navigation
Jump to search
See Compact Disc for the storage medium.
The cd command, short for "change directory", changes the current working directory, allowing the traversal of a filesystem.
Availability
Effectively, cd is universally available, being used in the command-line interface of Windows, and a built-in part of shells for Unix and Unix-like systems, including all Linux distributions (possibly excluding extremely minimal embedded operating systems), FreeBSD, OpenBSD, MacOS, Solaris and Solaris-based distributions, and more.
Usage
See the builtin section of your shell's manual for support options and variables.
- If the command is ran without any arguments, it will change directory into the directory set by variable CDPATH, or the user's home directory by default.
cd -
will change directory into the last directory.
Example
$ pwd /home/user $ mkdir test-directory $ cd test-directory $ pwd /home/user/test-directory $ cd - $ pwd /home/user