The usage of the Linux Shell commands cd and ls
This article introduces the relevant knowledge of "the usage of Linux Shell command cd and ls". Many people will encounter such a dilemma in the operation of actual cases, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!
General usage
Cd
Directory switching command
[root@localhost ~] # cd / home/ (switch to home directory)
[root@localhost /] # cd ~ (switch to the current user home directory)
[root@localhost /] # cd ~ / test (switch to the test directory under the current user home directory)
[root@localhost /] # cd-(switch to the last directory)
[root@localhost ~] # cd.. / (switch to the previous directory)
[root@localhost ~] # cd.. / (switch to the upper two-level directory)
Pwd displays the current directory
[root@localhost mail] # pwd-P (directory is a soft connection, showing the actual physical address)
/ var/spool/mail
[root@localhost mail] # pwd-L (display logical address)
/ var/mail
Ls
Display directory or file information as a list
[root@localhost /] # ls (displays the name of a file or directory in the current directory horizontally)
Bin dev home lib64
[root@localhost /] # ls-l (displays file or directory information in the current directory as a list)
Total 98
Dr-xr-xr-x. 2 root root 4096 May 23 2018 bin
Dr-xr-xr-x. 5 root root 1024 May 17 2018 boot
[root@localhost /] # ls / bin (displays the name of the file or directory in the / bin directory horizontally)
[root@localhost /] # ls-d * / (displays all directory names in the current directory horizontally)
Bin/ dev/ home/ lib64/
This is the end of the introduction to "the usage of Linux Shell commands cd and ls". Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!