Summary of Linux commands-first command: CD

Source: Internet
Author: User

Description

Bold section for commands such as:chmod +x file

[] inside is the full name of the command, bold as CD [change directory]

The command option is placed in [] inside such as: [-R] [-d]

Start with//or the end of the command is a comment, in italic bold display like //See here

The command output is shown in black and bold as: -rw-r--r--1 root root

text descriptions are displayed in normal fonts such as: see here

Important description information has the bottom color mainly yellow as: here is the point.

This blog system environment, the use of software, connection tools, system resources will be described in the beginning, if only the command to describe the system environment, thank you!


System Environment: Centos 7.2

Kernel version: 3.10.0-327.el7.x86_64

Installation Environment: Desktop installation

Virtual machine installation, virtual machine version: VMware Workstation 12


CD [Change Directory]

Path: None

Role: Switch Directories

Command format:

CD [option] target directory [target directory]

[-]

[~]

Action commands

Enter the system root directory

[[email protected] ~]# CD/

[Email protected]/]#

[Email protected]/]# pwd

/


Go to the previous directory, which is the home directory of root

[[email protected] ~]# CD/

[Email protected]/]# cd/root/

[[email protected]/]# pwd //show current working path

/root


Or

[[email protected]/]# CD ~ //~ represents the home directory of the current user

[Email protected] ~]#

[Email protected]/]# pwd

/root


Or

[Email protected]/]# CD $! // is to switch to the working directory you used last time

[Email protected] ~]#

[Email protected]/]# pwd

/root


Or

[[email protected]/]# CD-//-means switch to previous working directory

/root

[Email protected] ~]# pwd

/root

Actual operation

Requirements: Go to/etc/sysconfig/network-scripts/Display current directory, go to the previous directory of the current directory, display the current directory, go to the /etc/sysconfig/ directory, and display, switch to/tmp/ Directory in the switch back (no absolute path switching is allowed)


[Email protected] ~]# cd/etc/sysconfig/network-scripts/

[Email protected] network-scripts]#

[Email protected] network-scripts]# pwd

/etc/sysconfig/network-scripts

[Email protected] network-scripts]# CD. /       //   .. /represents the previous working directory

[Email protected] sysconfig]# pwd

/etc/sysconfig


[Email protected] sysconfig]# cd/tmp/

[Email protected] tmp]# pwd

/tmp


[Email protected] tmp]# CD-

/etc/sysconfig

[Email protected] sysconfig]# pwd

/etc/sysconfig





This article is from the "12083631" blog, please be sure to keep this source http://12093631.blog.51cto.com/12083631/1854890

Summary of Linux commands-first command: 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.