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