CD of Common Linux commands

Source: Internet
Author: User

1. Command function

CD: Toggle the current working directory

2. Command format

CD [directory name or directory path]

3. Command instances

Example 1: Switching the root directory

[Email protected] ~]# pwd

/root

[[Email protected] ~]# CD/

[Email protected]/]# pwd

/

Example 2: Switch to the top level directory

[Email protected] ~]# pwd

/root

[Email protected] ~]# CD.

[Email protected]/]# pwd

/

Example 3: Switch to the host directory: [~] can be omitted

[Email protected] ~]# cd/etc/init.d/

[Email protected] init.d]# pwd

/etc/init.d

[Email protected] init.d]# CD ~

[Email protected] ~]# pwd

/root

Example 4: Switch to the specified directory

[Email protected] ~]# pwd

/root

[Email protected] ~]# cd/etc/init.d/

[Email protected] init.d]# pwd

/etc/init.d

[Email protected] init.d]# cd/dev/

[Email protected] dev]# pwd

/dev

Example 5: Switch to a directory before switching

[Email protected] ~]# cd/etc/

[Email protected] etc]# pwd

/etc

[Email protected] etc]# cd/dev/

[Email protected] dev]# pwd

/dev

[Email protected] dev]# CD-

/etc

[Email protected] etc]# pwd

/etc

[Email protected] etc]# CD-

/dev

[Email protected] dev]# pwd

/dev









This article is from the "cold-blooded Killer" blog, please be sure to keep this source http://deathkiller.blog.51cto.com/9130248/1592320

CD of Common Linux commands

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.