Tips for using the CD command

Source: Internet
Author: User
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-

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.