Linux命令之ls

来源:互联网 发布:网络测速上传速度为零 编辑:程序博客网 时间:2024/05/16 09:16

What? 

列出目录的内容


How?

ls [-ABCFGHLOPRSTUW@abcdefghiklmnopqrstuwx1] [file ...]


Points——常用的参数

ls -l 显示目录文件的详细信息[linux文件的属性]

ls -t 按修改时间逆序排列

ls -r reverse 按相反顺序排列

ls -F 标识文件的类型 /表示目录   *表示可执行文件   @表示软连接   =表示socket文件   |表示管道文件  这些标识符跟在文件名后面


Example

显示该目录下文件详细信息,按修改时间逆序排列(最新修改的在最下面)

➜  test  ls -lrtFtotal 8drwxr-xr-x  2 a2014  staff  68  1 20 18:07 movies/drwxr-xr-x  2 a2014  staff  68  1 20 18:07 music/drwxr-xr-x  2 a2014  staff  68  1 20 18:07 download/drwxr-xr-x  2 a2014  staff  68  1 20 18:08 documents/drwxr-xr-x  2 a2014  staff  68  1 20 18:08 pictures/-rw-r--r--  1 a2014  staff   2  1 20 18:27 test.txt-rw-r--r--  1 a2014  staff   0  1 20 18:28 test1.txt

total——该目录下文件和目录的大小,单位KB

其余详见linux文件的详细属性

0 0
原创粉丝点击