2.3 ls命令

来源:互联网 发布:2016新疆4g网络限制 编辑:程序博客网 时间:2024/06/16 20:23

    • 常用组合
    • 命令详解
      • ls -l显示文件详细信息
      • ls -i显示文件iNode号
      • ls -lh 以更人性化的显示文件大小
      • ls -la 显示隐藏文件
      • 详细信息iNode号5的含义
      • ls -t以时间的顺序排序
      • ls -d显示目录本身详细信息

常用组合

ls -lhtr

命令详解

ls -l:显示文件详细信息

# ls -l总用量 4-rw-------. 1 root root 1456 4月  23 23:29 anaconda-ks.cfg第一列:文件权限 第二列:有多少文件使用相同的iNode第三列:所有者第四列:所属组第五列:文件大小,单位为byte第六列:文件创建时间第七列:文件名

ls -i:显示文件iNode号

# ls -i anaconda-ks.cfg 71 anaconda-ks.cfg

ls -lh :以更人性化的显示文件大小

-rw-------. 1 root root 1.5K 423 23:29 anaconda-ks.cfg

ls -la :显示隐藏文件

# ls -al总用量 40dr-xr-x---.  5 root root  207 6月   3 09:40 .dr-xr-xr-x. 18 root root  236 6月   2 19:08 ..-rw-------.  1 root root 1456 4月  23 23:29 anaconda-ks.cfg-rw-------.  1 root root 4322 6月   3 00:34 .bash_history-rw-r--r--.  1 root root   18 12月 29 2013 .bash_logout-rw-r--r--.  1 root root  176 12月 29 2013 .bash_profile-rw-r--r--.  1 root root  176 12月 29 2013 .bashrcdrwx------.  3 root root   17 4月  27 16:02 .cache-rw-r--r--.  1 root root  100 12月 29 2013 .cshrc-rw-r--r--.  1 root root   49 6月   3 00:15 .gitconfigdrwxr-----.  3 root root   19 4月  27 15:55 .pkidrwx------.  2 root root   80 6月   3 00:09 .ssh-rw-r--r--.  1 root root  129 12月 29 2013 .tcshrc-rw-------.  1 root root 3919 6月   3 09:40 .viminfo

详细信息iNode号5的含义

dr-xr-x—. 5 root root 207 6月 3 09:40 .

[root@suning-02 ~]# ls -i /root71 anaconda-ks.cfg[root@suning-02 ~]# ls -i .71 anaconda-ks.cfg[root@suning-02 ~]# ls -i .cache/..71 anaconda-ks.cfg[root@suning-02 ~]# ls -i .pki/..71 anaconda-ks.cfg[root@suning-02 ~]# ls -i .ssh/..71 anaconda-ks.cfg

ls -t:以时间的顺序排序

dr-xr-x---.  5 root root  207 63 09:40 .-rw-------.  1 root root 3919 63 09:40 .viminfo-rw-------.  1 root root 4322 63 00:34 .bash_history-rw-r--r--.  1 root root   49 63 00:15 .gitconfigdrwx------.  2 root root   80 63 00:09 .sshdr-xr-xr-x. 18 root root  236 62 19:08 ..drwx------.  3 root root   17 427 16:02 .cachedrwxr-----.  3 root root   19 427 15:55 .pki-rw-------.  1 root root 1456 423 23:29 anaconda-ks.cfg-rw-r--r--.  1 root root   18 1229 2013 .bash_logout-rw-r--r--.  1 root root  176 1229 2013 .bash_profile-rw-r--r--.  1 root root  176 1229 2013 .bashrc-rw-r--r--.  1 root root  100 1229 2013 .cshrc-rw-r--r--.  1 root root  129 1229 2013 .tcshrc

ls -d:显示目录本身详细信息

dr-xr-x---. 5 root root 207 63 09:40 /root
原创粉丝点击