美文网首页
df命令 du命令

df命令 du命令

作者: Santiagogogo | 来源:发表于2017-04-17 01:00 被阅读0次

    实例6:以更易读的方式显示目前磁盘空间和使用情况

    命令: df -h

    实例1: 显示磁盘使用情况 

    命令:df

    3.命令参数:

    必要参数:

    -a 全部文件系统列表

    -h 方便阅读方式显示

    -H 等于“-h”,但是计算式,1K=1000,而不是1K=1024

    -i 显示inode信息

    -k 区块为1024字节

    -l 只显示本地文件系统

    -m 区块为1048576字节

    --no-sync 忽略 sync 命令

    -P 输出格式为POSIX

    --sync 在取得磁盘信息前,先执行sync命令

    -T 文件系统类型

    选择参数:

    --block-size=<区块大小> 指定区块大小

    -t<文件系统类型> 只显示选定文件系统的磁盘信息

    -x<文件系统类型> 不显示选定文件系统的磁盘信息

    --help 显示帮助信息

    --version 显示版本信息

    实例10   显示当前目录下所有子目录的容量,降序排列

    du -s *|sort -n

    实例6:方便阅读的格式显示

    命令:

    du -h test

    输出:

    [root@localhost soft]#du -h test

    608K    test/test6

    308K    test/test4

    4.0K    test/scf/lib

    4.0K    test/scf/service/deploy/product

    4.0K    test/scf/service/deploy/info

    12K     test/scf/service/deploy

    16K     test/scf/service

    4.0K    test/scf/doc

    4.0K    test/scf/bin

    32K     test/scf

    8.0K    test/test3

    1.3M    test

    [root@localhost soft]#

    说明:

    实例7:文件和目录都显示

    命令:

    输出:

    [root@localhost soft]#du -ah test

    4.0K    test/log31.tar.gz

    4.0K    test/test13.tar.gz

    0       test/linklog.log

    0       test/test6/log2014.log

    300K    test/test6/linklog.log

    0       test/test6/log2015.log

    4.0K    test/test6/log2013.log

    300K    test/test6/log2012.log

    0       test/test6/log2017.log

    0       test/test6/log2016.log

    608K    test/test6

    0       test/log2015.log

    0       test/test4/log2014.log

    4.0K    test/test4/log2013.log

    300K    test/test4/log2012.log

    308K    test/test4

    4.0K    test/scf/lib

    4.0K    test/scf/service/deploy/product

    4.0K    test/scf/service/deploy/info

    12K     test/scf/service/deploy

    16K     test/scf/service

    4.0K    test/scf/doc

    4.0K    test/scf/bin

    32K     test/scf

    4.0K    test/log2013.log

    300K    test/log2012.log

    0       test/log2017.log

    0       test/log2016.log

    4.0K    test/log30.tar.gz

    4.0K    test/log.tar.bz2

    4.0K    test/log.tar.gz

    0       test/test3/log2014.log

    4.0K    test/test3/log2013.log

    8.0K    test/test3

    4.0K    test/scf.tar.gz

    1.3M    test

    实例2:显示指定文件所占空间

    命令:

    du log2012.log

    输出:

    [root@localhost test]#du log2012.log

    300log2012.log

    [root@localhost test]#

    说明:

    实例3:查看指定目录的所占空间

    命令:

    du scf

    输出:

    [root@localhost test]#du scf

    4       scf/lib

    4       scf/service/deploy/product

    4       scf/service/deploy/info

    12      scf/service/deploy

    16      scf/service

    4       scf/doc

    4       scf/bin

    32scf

    [root@localhost test]#

    说明:

    实例4:显示多个文件所占空间

    命令:

    du log30.tar.gz log31.tar.gz

    输出:

    [root@localhost test]#du log30.tar.gz log31.tar.gz

    4log30.tar.gz

    4log31.tar.gz

    [root@localhost test]#

    相关文章

      网友评论

          本文标题:df命令 du命令

          本文链接:https://www.haomeiwen.com/subject/ulmzattx.html