English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

Linux cd Command

Linux Command大全

The Linux cd (full English name: change directory) command is used to switch the current working directory.

The dirName notation can be an absolute path or a relative path. If the directory name is omitted, it will switch to the user's home directory (that is, the directory when login occurred).

Additionally, ~ also means the home directory, . is the current directory, and .. is the parent directory of the current directory.

Syntax

cd [dirName]
  • dirName: The target directory to switch to.

Online Examples

Go to /usr/bin/ :

cd /usr/bin

Go to your home directory:

cd ~

Go to the parent directory of the current directory:

cd ../..

Linux Command大全