Linux cd command (4)

It can be said that everything on Linux starts with the cd command. cd is short for change directory, its role is to change the current working directory.

use cd

For the use of this command, needless to say, we often use it in cmd under Windows. Two points to note are:

  1. cd must be followed by a directory name, not a file name
  2. File names in Linux are case-sensitive and cannot be mixed

In addition to the directory name, you can also follow some characters, their specific meanings are as follows:

Order meaning
cd Enter the user home directory
cd ~ Enter the user home directory (same as above)
cd . keep the current directory unchanged
cd .. switch to the parent directory
cd - Can switch back and forth between the last two working directories

You can try it in your own Linux environment.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324612961&siteId=291194637