码迷,mamicode.com
首页 > 系统相关 > 详细

linux命令之ls(list directory contents-->列出目录内容)

时间:2019-05-10 09:25:46      阅读:161      评论:0      收藏:0      [点我收藏+]

标签:排序   enter   color   信息   soft   img   目录   mil   12月   

ls-->该命令为列出默认当前目录下的文件的相关信息,没有其他特别排序要求外,默认按字母升序排列

格式:  ls [选项] [参数]

常用选项:  

-l长列表的格式列出指定目录下的文件或目录的元数据信息

-h以易读的方式显示

-d显示当前目录自己的元数据信息

-a显示包括隐藏文件(该文件常以点开头)

 1 [root@localhost ~]$ ls -l
 2 总用量 4
 3 -rw-------. 1 root root 1241 5月   8 13:40 anaconda-ks.cfg
 4 drwxr-xr-x. 2 root root   23 5月   8 17:47 mybash
 5 [root@localhost ~]$ ls -lhd
 6 dr-xr-x---. 3 root root 165 5月   9 15:42 .
 7 [root@localhost ~]$ ls -lh
 8 总用量 4.0K
 9 -rw-------. 1 root root 1.3K 5月   8 13:40 anaconda-ks.cfg
10 drwxr-xr-x. 2 root root   23 5月   8 17:47 mybash
11 [root@localhost ~]$ ls -l /root
12 总用量 4
13 -rw-------. 1 root root 1241 5月   8 13:40 anaconda-ks.cfg
14 drwxr-xr-x. 2 root root   23 5月   8 17:47 mybash
15 [root@localhost ~]$ ls -ld /root
16 dr-xr-x---. 3 root root 165 5月   9 15:42 /root
17 [root@localhost ~]$ ls -al
18 总用量 32
19 dr-xr-x---.  3 root root  165 5月   9 15:42 .
20 dr-xr-xr-x. 17 root root  224 5月   8 13:38 ..
21 -rw-------.  1 root root 1241 5月   8 13:40 anaconda-ks.cfg
22 -rw-------.  1 root root  600 5月   9 18:42 .bash_history
23 -rw-r--r--.  1 root root   18 12月 29 2013 .bash_logout
24 -rw-r--r--.  1 root root  176 12月 29 2013 .bash_profile
25 -rw-r--r--.  1 root root  209 5月   8 15:50 .bashrc
26 -rw-r--r--.  1 root root  100 12月 29 2013 .cshrc
27 drwxr-xr-x.  2 root root   23 5月   8 17:47 mybash
28 -rw-r--r--.  1 root root  129 12月 29 2013 .tcshrc
29 -rw-------.  1 root root 1162 5月   9 15:42 .viminfo

 技术图片元数据信息  drwxr-xr-x. 2 root root 23 5月 8 17:47 mybash

linux命令之ls(list directory contents-->列出目录内容)

标签:排序   enter   color   信息   soft   img   目录   mil   12月   

原文地址:https://www.cnblogs.com/holdononedream/p/10842433.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!