linux The meaning and usage of cd

  • 2021-01-19 22:44:37
  • OfStack

linux What does cd mean?

In linux, cd stands for change, directory for switching directories.

Linux The cd command is used to switch the current working directory to dirName(directory parameter).

Where the dirName representation can be an absolute path or a relative path. If the directory name is omitted, change to the user's home directory (the same directory as when login was started).

In addition, "~" also means home directory, "." is the current directory, ".." Represents the directory level 1 above the current directory location.

grammar


cd [dirName]

dirName: The destination directory to switch to.

The instance

Jump/usr/bin / :


cd /usr/bin

Skip to your own home directory:


cd ~

Skip to two levels above the current directory:


cd ../..


Related articles: