使用 ls 命令显示有关目录中所有文件的信息。
在以下示例中,显示了 /sbin 目录中部分文件的列表。
% cd /sbin % ls -la total 13456 drwxr-xr-x 2 root sys 512 Sep 1 14:11 . drwxr-xr-x 29 root root 1024 Sep 1 15:40 .. -r-xr-xr-x 1 root bin 218188 Aug 18 15:17 autopush lrwxrwxrwx 1 root root 21 Sep 1 14:11 bpgetfile -> ... -r-xr-xr-x 1 root bin 505556 Aug 20 13:24 dhcpagent -r-xr-xr-x 1 root bin 456064 Aug 20 13:25 dhcpinfo -r-xr-xr-x 1 root bin 272360 Aug 18 15:19 fdisk -r-xr-xr-x 1 root bin 824728 Aug 20 13:29 hostconfig -r-xr-xr-x 1 root bin 603528 Aug 20 13:21 ifconfig -r-xr-xr-x 1 root sys 556008 Aug 20 13:21 init -r-xr-xr-x 2 root root 274020 Aug 18 15:28 jsh -r-xr-xr-x 1 root bin 238736 Aug 21 19:46 mount -r-xr-xr-x 1 root sys 7696 Aug 18 15:20 mountall . . . |
每一行按以下顺序显示了有关文件的信息:
文件的类型-例如,d。有关文件类型的列表,请参见文件和目录的拥有权。
权限-例如,r-xr-xr-x。有关说明,请参见文件和目录的拥有权。
硬链接数-例如,2。
文件的属主-例如,root。
文件的组-例如,bin。
文件的大小(以字节为单位)-例如,7696。
创建文件的日期或上次更改文件的日期-例如,Aug 18 15:20。
文件名-例如,mountall。