ArticleDirectory
- Quickly switch to the Home Directory
- Quickly switch to a user's home directory
- Switch to the current directory used last time
Here are some tips for using the CD command.
Quickly switch to the Home Directory
In Linux ,~ Indicates the current user's home directory. to quickly switch to your home directory, run the following command:
Cd ~
Or use CD directly.
CD
Quickly switch to a user's home directory
How can I switch to a user's home directory? For example, to switch to the Home Directory of the root user, run the following command:
Cd ~ Root
Switch to the current directory used last time
Suppose we need to do a lot of things in the/usr/local/src directory now. In this process, we need to temporarily switch to the home directory:
Cd ~... # Processing in the Home Directory
We have done everything in the home directory. Now we have to go back to the/usr/local/src directory. How can we go back?
Method 1: traditional methods:
CD/usr/local/src
Method 2: This is the new method we want to talk about. Using-(short horizontal line) can help us quickly return to the current directory used last time.
CD-