Linux Commands learning Note (2): cd command

Source: Internet
Author: User

Linux CD commands can be said to be the most basic Linux command statements, the other command statements to operate, are based on the use of the CD command.  Therefore, to learn the common Linux commands, the first step is to learn how to use the CD command skills. 1. Command format: CD [directory name]2. Command function: Switch current directory to dirname3. Common examples3.1Example One: Enter the system root command: CD/output: [[email protected]~]# CD/Note: Enter the system root directory, the above command after the execution of the LS command to see, the current directory has been to the system root directory command: CD. or CD .//Output:1[Email protected] soft]#pwd2/opt/Soft3[email protected] soft]# CD .4[Email protected] opt]# CD.//5[Email protected]/]#pwd6/Description: Enter the system root directory to use the CD. "Keep going, you can reach the root directory command: CD./..//Output:1[Email protected] soft]#pwd2/opt/Soft3[Email protected] soft]# CD. /..//4[Email protected]/]#pwd5/6[[Email protected]/] #说明: Use the CD command to implement the parent directory into the parent directory of the current directory. Example 2: Using the CD command to enter the current user home directory "Current user home Directory" and "system root" are two different concepts. There are two methods to enter the current user home directory. Command 1:CD output:1[Email protected] soft]#pwd2/opt/Soft3[[Email protected] soft]# CD4[Email protected] ~]#pwd5/root command 2:cd~Output:1[Email protected] ~]# cd/opt/soft/2[Email protected] soft]#pwd3/opt/Soft4[Email protected] soft]# CD ~5[Email protected] ~]#pwd6/Root Example 3: Jump to the specified directory command: CD/opt/Soft output:1[Email protected] ~]# cd/opt/Soft2[Email protected] soft]#pwd3/opt/Soft4[Email protected] soft]# CD JDK1.6.0_16/5[Email protected] jdk1.6.0_16]#pwd6/opt/soft/jdk1.6. 0_167[Email protected] jdk1.6. 0_16] #说明: Jump to the specified directory, starting with the root directory, and/, the subdirectory in the current directory directly writes the name to example four: Returns the directory where the directory was before the command: CD-Output:1[Email protected] soft]#pwd2/opt/Soft3[Email protected] soft]# CD-4/Root5[Email protected] ~]#pwd6/Root7[Email protected] ~]# CD-8/opt/Soft9[[email protected] soft] #例五: Use the parameters of the previous command as CD parameters. Command: CD!$ output:1[[Email protected] soft]# CD!$2CD-3/Root4[[Email protected] ~]# CD!$5CD-6/opt/Soft7[Email protected] soft]#

Linux Commands learning Note (2): cd command

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.