The most basic command in cd-command Linux commands is one of the most commonly used commands. When using Linux commands, almost all cd commands are used. Therefore, to learn Linux commands, cd commands must be mastered. Xiaobian together to learn more about the cd command.
1. Command Format:
cd [directory name]
2. Function:
change the current directory to dirName
3. Common Examples
3.1 Example 1: Entering the System Root
Command:
cd /
Output:
[root@localhost ~]# cd /
Description: Enter the system root directory. After the above command is executed, take the ls command to see that the current directory has reached the system root directory.
cd . . Or cd. . //
Output:
1 [root@localhost soft]# pwd
2 /opt/soft
3 [root@localhost soft]# Cd. .
4 [root@localhost opt]# cd . . //
5 [root@localhost /]# pwd
6 /
Description:
You can use “ cd to enter the system root directory. . ” Always retreat, you can reach the root directory
Command:
cd . . /. . //
Output:
1 [root@localhost soft]# pwd
2 /opt/soft
3 [root@localhost soft]# Cd. . /. . //
4 [root@localhost /]# pwd
5 /
6 [root@localhost /]#
Description: Use the cd command Implements the parent directory of the parent directory that goes into the current directory.
Example 2: Using the cd command to enter the current user home directory
“The current user home directory” and “system root directory” are two different concepts. There are two ways to enter the current user home directory.
Command 1:
cd
Output:
1 [root@localhost soft]# pwd
2 /opt/soft
3 [root@localhost soft]# cd
4 [root@localhost ~]# pwd
5 /root
Previous12Next 2 pages
Printing a file on a Linux system can use the pr command, and pr is a shorthand for
What are file attributes and what are the attributes of the file? I believe many people are not very
Linux files are very difficult to clean up. There are many files of large and small size. It is the
Linux system operation, sometimes need to modify the environment variable PATH path
How to install and set up Samba service
How to deal with the problem of Linux system downtime
How to restart Tomcat regularly on Linux system
Red Flag Linux6.0 system to install VirtualBox skills
What should I do if Ubuntu is installed and restarted after VM Virtualbox?
Linux how to debug multi-process program
Modify Linux password prompt it is based on a dictionary word What to do?
Linux finds the way to replace text content by command.
How does the CentOS system remove IP from the Fail2ban blacklist
How to convert a video file into an mp3 audio file using a format factory?
Win10 Redstone Preview 14267 updated what Win10 Redstone Preview 14267 update content summary
How to determine if your WinXP is the official version
Computer Acceleration and Computer Optimization Techniques
Which is better for Windows 7 and Windows XP?
How to add Flash plugin for IE browser in Win8
Wonderful use of U disk easily bypass Win XP login password