{"id":101,"date":"2019-03-09T18:15:15","date_gmt":"2019-03-09T10:15:15","guid":{"rendered":"https:\/\/www.linuxcool.com\/?p=101"},"modified":"2022-04-30T18:35:07","modified_gmt":"2022-04-30T10:35:07","slug":"ls","status":"publish","type":"post","link":"https:\/\/www.linuxcool.com\/ls","title":{"rendered":"ls\u547d\u4ee4 – \u663e\u793a\u6307\u5b9a\u5de5\u4f5c\u76ee\u5f55\u4e0b\u7684\u6587\u4ef6\u53ca\u5c5e\u6027\u4fe1\u606f"},"content":{"rendered":"\n

ls\u662f\u6700\u5e38\u88ab\u4f7f\u7528\u5230\u7684Linux\u547d\u4ee4\u4e4b\u4e00\uff0c\u6765\u81ea\u4e8e\u82f1\u6587\u5355\u8bcdlist\u7684\u7f29\u5199\uff0c\u4e5f\u6b63\u5982list\u5355\u8bcd\u7684\u82f1\u6587\u610f\u601d\uff0c\u5176\u529f\u80fd\u662f\u5217\u4e3e\u51fa\u6307\u5b9a\u76ee\u5f55\u4e0b\u7684\u6587\u4ef6\u540d\u79f0\u53ca\u5176\u5c5e\u6027\u3002<\/p>\n\n\n\n

\u9ed8\u8ba4\u4e0d\u52a0\u53c2\u6570\u7684\u60c5\u51b5\u4e0b\uff0cls\u547d\u4ee4\u4f1a\u5217\u51fa\u5f53\u524d\u5de5\u4f5c\u76ee\u5f55\u4e2d\u7684\u6587\u4ef6\u4fe1\u606f\uff0c\u7ecf\u5e38\u4e0ecd\u548cpwd\u547d\u4ee4\u642d\u914d\u4f7f\u7528\uff0c\u5341\u5206\u65b9\u4fbf\u3002\u800c\u5e26\u4e0a\u53c2\u6570\u540e\uff0c\u6211\u4eec\u5219\u53ef\u4ee5\u505a\u66f4\u591a\u7684\u4e8b\u60c5\uff0c\u4f5c\u4e3a\u6700\u57fa\u7840\u3001\u6700\u9891\u7e41\u4f7f\u7528\u7684\u547d\u4ee4\uff0c\u6709\u5fc5\u8981\u4ed4\u7ec6\u4e86\u89e3\u4e0b\u5176\u5e38\u7528\u529f\u80fd\u3002<\/p>\n\n\n\n

\u8bed\u6cd5\u683c\u5f0f: <\/strong>ls [\u53c2\u6570] [\u6587\u4ef6] <\/p>\n\n\n\n

\u5e38\u7528\u53c2\u6570\uff1a<\/strong><\/p>\n\n\n\n

-a<\/td>\u663e\u793a\u6240\u6709\u6587\u4ef6\u53ca\u76ee\u5f55 (\u5305\u62ec\u4ee5\u201c.\u201d\u5f00\u5934\u7684\u9690\u85cf\u6587\u4ef6) <\/td><\/tr>
-l<\/td>\u4f7f\u7528\u957f\u683c\u5f0f\u5217\u51fa\u6587\u4ef6\u53ca\u76ee\u5f55\u7684\u8be6\u7ec6\u4fe1\u606f<\/td><\/tr>
-r<\/td>\u5c06\u6587\u4ef6\u4ee5\u76f8\u53cd\u6b21\u5e8f\u663e\u793a(\u9ed8\u8ba4\u4f9d\u82f1\u6587\u5b57\u6bcd\u6b21\u5e8f) <\/td><\/tr>
-t<\/td>\u6839\u636e\u6700\u540e\u7684\u4fee\u6539\u65f6\u95f4\u6392\u5e8f <\/td><\/tr>
-A<\/td>\u540c -a \uff0c\u4f46\u4e0d\u5217\u51fa \u201c.\u201d (\u5f53\u524d\u76ee\u5f55) \u53ca \u201c..\u201d (\u7236\u76ee\u5f55) <\/td><\/tr>
-S<\/td>\u6839\u636e\u6587\u4ef6\u5927\u5c0f\u6392\u5e8f<\/td><\/tr>
-R<\/td>\u9012\u5f52\u5217\u51fa\u6240\u6709\u5b50\u76ee\u5f55<\/td><\/tr>
-d<\/td>\u67e5\u770b\u76ee\u5f55\u7684\u4fe1\u606f\uff0c\u800c\u4e0d\u662f\u91cc\u9762\u5b50\u6587\u4ef6\u7684\u4fe1\u606f<\/td><\/tr>
-i<\/td>\u8f93\u51fa\u6587\u4ef6\u7684inode\u8282\u70b9\u4fe1\u606f<\/td><\/tr>
-m<\/td>\u6c34\u5e73\u5217\u51fa\u6587\u4ef6\uff0c\u4ee5\u9017\u53f7\u95f4\u9694<\/td><\/tr>
-X<\/td>\u6309\u6587\u4ef6\u6269\u5c55\u540d\u6392\u5e8f<\/td><\/tr>
--color<\/td>\u8f93\u51fa\u4fe1\u606f\u4e2d\u5e26\u6709\u7740\u8272\u6548\u679c<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n

\u53c2\u8003\u5b9e\u4f8b<\/strong><\/p>\n\n\n\n

\u8f93\u51fa\u5f53\u524d\u76ee\u5f55\u4e2d\u7684\u6587\u4ef6\uff08\u9ed8\u8ba4\u4e0d\u542b\u9690\u85cf\u6587\u4ef6\uff09\uff1a<\/p>\n\n\n\n

[root@linuxcool ~]# ls<\/strong>\nanaconda-ks.cfg  Documents  initial-setup-ks.cfg  Pictures  Templates\nDesktop          Downloads  Music                 Public    Videos<\/pre>\n\n\n\n

\u8f93\u51fa\u5f53\u524d\u76ee\u5f55\u4e2d\u7684\u6587\u4ef6\uff08\u542b\u9690\u85cf\u6587\u4ef6\uff09\uff1a<\/p>\n\n\n\n

[root@linuxcool ~]# ls -a<\/strong>\n.                .bashrc  Documents             Music      Videos\n..               .cache   Downloads             Pictures   .viminfo\nanaconda-ks.cfg  .config  .esd_auth             .pki\n.bash_history    .cshrc   .ICEauthority         Public\n.bash_logout     .dbus    initial-setup-ks.cfg  .tcshrc\n.bash_profile    Desktop  .local                Templates<\/pre>\n\n\n\n

\u8f93\u51fa\u6587\u4ef6\u7684\u957f\u683c\u5f0f\uff0c\u5305\u542b\u5c5e\u6027\u8be6\u60c5\u4fe1\u606f\uff1a<\/p>\n\n\n\n

[root@linuxcool ~]# ls -l<\/strong>\ntotal 8\n-rw-------. 1 root root 1430 Dec 14 08:05 anaconda-ks.cfg\ndrwxr-xr-x. 2 root root    6 Dec 14 08:37 Desktop\ndrwxr-xr-x. 2 root root    6 Dec 14 08:37 Documents\ndrwxr-xr-x. 2 root root    6 Dec 14 08:37 Downloads\n-rw-r--r--. 1 root root 1585 Dec 14 08:34 initial-setup-ks.cfg\ndrwxr-xr-x. 2 root root    6 Dec 14 08:37 Music\ndrwxr-xr-x. 2 root root    6 Dec 14 08:37 Pictures\ndrwxr-xr-x. 2 root root    6 Dec 14 08:37 Public\ndrwxr-xr-x. 2 root root    6 Dec 14 08:37 Templates\ndrwxr-xr-x. 2 root root    6 Dec 14 08:37 Videos<\/pre>\n\n\n\n

\u8f93\u51fa\u6307\u5b9a\u76ee\u5f55\u4e2d\u7684\u6587\u4ef6\u5217\u8868\uff1a<\/p>\n\n\n\n

[root@linuxcool ~]# ls \/etc<\/strong>\nadjtime                     hosts                     pulse\naliases                     hosts.allow               qemu-ga\nalsa                        hosts.deny                qemu-kvm\nalternatives                hp                        radvd.conf\nanacrontab                  idmapd.conf               ras\nasound.conf                 init.d                    rc0.d\nat.deny                     inittab                   rc1.d\n\u2026\u2026\u2026\u2026\u2026\u2026\u7701\u7565\u90e8\u5206\u8f93\u51fa\u4fe1\u606f\u2026\u2026\u2026\u2026\u2026\u2026<\/pre>\n\n\n\n

\u8f93\u51fa\u6587\u4ef6\u540d\u79f0\u53cainode\u5c5e\u6027\u5757\u53f7\u7801\uff1a <\/p>\n\n\n\n

[root@linuxcool ~]# ls -i<\/strong>\n35290115 anaconda-ks.cfg  35290137 initial-setup-ks.cfg  35290164 Templates\n 1137391 Desktop          17840039 Music                 51609597 Videos\n 1137392 Documents        35290165 Pictures\n17840038 Downloads        51609596 Public<\/pre>\n\n\n\n

\u642d\u914d\u901a\u914d\u7b26\u4e00\u8d77\u4f7f\u7528\uff0c\u8f93\u51fa\u6307\u5b9a\u76ee\u5f55\u4e2d\u6240\u6709\u4ee5sd\u5f00\u5934\u7684\u6587\u4ef6\u540d\u79f0\uff1a<\/p>\n\n\n\n

[root@linuxcool ~]# ls \/dev\/sd*<\/strong>\n\/dev\/sda  \/dev\/sda1  \/dev\/sda2<\/pre>\n\n\n\n

\u4f9d\u636e\u6587\u4ef6\u5927\u5c0f\u8fdb\u884c\u6392\u5e8f\uff0c\u8f93\u51fa\u6307\u5b9a\u76ee\u5f55\u4e2d\u6587\u4ef6\u5c5e\u6027\u8be6\u60c5\u4fe1\u606f\uff1a<\/p>\n\n\n\n

[root@linuxcool ~]# ls -Sl \/etc<\/strong>\ntotal 1348\n-rw-r--r--.  1 root root    692241 Sep 10  2018 services\n-rw-r--r--.  1 root root     66482 Dec 14 08:34 ld.so.cache\n-rw-r--r--.  1 root root     60352 May 11  2017 mime.types\n-rw-r--r--.  1 root dnsmasq  26843 Aug 12  2018 dnsmasq.conf\n-rw-r--r--.  1 root root     25696 Dec 12  2018 brltty.conf\n-rw-r--r--.  1 root root      9450 Aug 12  2018 nanorc\n-rw-r--r--.  1 root root      7265 Dec 14 08:03 kdump.conf\n-rw-------.  1 tss  tss       7046 Aug 13  2018 tcsd.conf\n\u2026\u2026\u2026\u2026\u2026\u2026\u7701\u7565\u90e8\u5206\u8f93\u51fa\u4fe1\u606f\u2026\u2026\u2026\u2026\u2026\u2026<\/pre>\n","protected":false},"excerpt":{"rendered":"

ls\u662f\u6700\u5e38\u88ab\u4f7f\u7528\u5230\u7684Linux\u547d\u4ee4\u4e4b\u4e00\uff0c\u6765\u81ea\u4e8e\u82f1\u6587\u5355\u8bcdlist\u7684\u7f29\u5199\uff0c\u4e5f\u6b63\u5982list\u5355\u8bcd\u7684\u82f1\u6587\u610f\u601d\uff0c\u5176\u529f\u80fd\u662f\u5217 […]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[],"_links":{"self":[{"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/posts\/101"}],"collection":[{"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/comments?post=101"}],"version-history":[{"count":20,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/posts\/101\/revisions"}],"predecessor-version":[{"id":9022,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/posts\/101\/revisions\/9022"}],"wp:attachment":[{"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/media?parent=101"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/categories?post=101"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/tags?post=101"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}