Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

The usage of the Linux Shell commands cd and ls

2025-01-31 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

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!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report