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:
- cd must be followed by a directory name, not a file name
- 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.