Linux cd commands and several tips on cd commands

Source: Internet
Author: User

The linux cd command is one of the two commands with the highest usage in Linux. The other is ls, of course ), I have never known the tips for seeing a linux cd command two days ago.

Cd-# Go Back To The Last directory. I didn't know this technique. It seems to be useful and I have omitted a lot of input.

Cd! $ # Input the parameters of the previous command.

Cd # return to the home directory

Cd ~ # Return to the home directory

The following is a coherent example:

Reference

Ocean @ flower-laptop :~ $ Pwd # view the current directory path

/Home/ocean

Ocean @ flower-laptop :~ $ Sudo tar xf wordpress.tar.gz-C/opt/lampp/htdocs/wordpress # decompress the compressed package to the/opt/lampp/htdocs/wordpress directory

Ocean @ flower-laptop :~ $ Cd! $ # Run linux cd! $ Use the last parameter of the previous command as the input, that is,/opt/lampp/htdocs/wordpress

Cd/opt/lampp/htdocs/wordpress

Ocean @ flower-laptop:/opt/lampp/htdocs/wordpress $ pwd # view the current directory path

/Opt/lampp/htdocs/wordpress

Ocean @ flower-laptop:/opt/lampp/htdocs/wordpress $ cd # Run the linux cd command to return to the home directory

Ocean @ flower-laptop :~ $ Pwd # view the current directory path

/Home/ocean

Ocean @ flower-laptop :~ $ Cd-# run linux cd-and return to the last directory.

/Opt/lampp/htdocs/wordpress

Ocean @ flower-laptop:/opt/lampp/htdocs/wordpress $ pwd # view the current directory path

/Opt/lampp/htdocs/wordpress

In this way, you can see how to use the linux cd command.

  • Xen Virtual Machine practice: How to Create a snapshot using Linux commands
  • Ten Linux commands you may have never used
  • Linux cd commands
    1. 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.