Welcome 微信登录

首页 / 操作系统 / Linux / Linux命令之ls 简述

What?列出目录的内容How?ls [-ABCFGHLOPRSTUW@abcdefghiklmnopqrstuwx1] [file ...]Points——常用的参数ls -l 显示目录文件的详细信息[linux文件的属性]ls -t 按修改时间逆序排列ls -r reverse 按相反顺序排列ls -F 标识文件的类型 /表示目录 *表示可执行文件 @表示软连接 =表示socket文件 |表示管道文件  这些标识符跟在文件名后面Example显示该目录下文件详细信息,按修改时间逆序排列(最新修改的在最下面)?  test  ls -lrtF
total 8
drwxr-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.txttotal——该目录下文件和目录的大小,单位KB其余详见下面的Linux文件的详细属性total 0
drwxr-xr-x  2 a2014  staff  68  1 20 18:08 documents
drwxr-xr-x  2 a2014  staff  68  1 20 18:07 download
drwxr-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:08 pictures
-rw-r--r--  1 a2014  staff 0  1 20 18:08 test.txttotal——该目录下文件和目录的大小,单位KB第一字段共有10个字符,第一个字符表示文件的类型,d表示路径,-表示普通文件;剩下的9个字符每3个一组表示Linux下ls命令的实现  http://www.linuxidc.com/Linux/2014-12/111079.htm本文永久更新链接地址