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 use of cd, pwd and ls commands of Linux

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

Share

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

This article is about how to use the cd, pwd, ls commands in Linux. I think it's very practical, so I share it with you. The following information is the contents of cd, pwd and ls commands.

cd

directory switch command

[root@localhost ~]# cd /home/

[root@localhost /]# cd ~(switch to current user home directory)

[root@localhost /]# cd ~/test (switch to the test directory in the current user's home directory)

[root@localhost /]# cd -(Switch to directory from previous switch)

[root@localhost ~]# cd ../ (Switch to the next level directory)

[root@localhost ~]# cd ../../ (Switch to the top two levels)

pwd shows the current directory

[root@localhost mail]# pwd -P (directories are soft links, showing actual physical addresses)

/var/spool/mail

[root@localhost mail]# pwd -L (Show logical address)

/var/mail

ls

Display directory or file information as a list

[root@localhost /]# ls (displays file or directory names 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 file or directory names in/bin in horizontal rows)

[root@localhost /]# ls -d */(Displays all directory names in the current directory in horizontal rows)

bin/ dev/ home/ lib64/

After reading this article, have you learned to use cd, pwd and ls? If you still want to learn more skills or want to know more about related content, welcome to pay attention to the industry information channel, thank you for reading.

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