说明
Linux du
命令也是查看使用空间的,但是与 df
命令不同的是linux du
命令是对文件和目录磁盘使用的空间的查看,还是和 du
命令有一些区别的.
命令格式:
du [选项][文件]
命令功能:
du [选项][文件]
显示每个文件和目录的磁盘使用空间。
命令参数:
参数 | 详解 |
---|---|
-a或-all | 显示目录中个别文件的大小。 |
-b或-bytes | 显示目录或文件大小时,以byte为单位。 |
-c或–total | 除了显示个别目录或文件的大小外,同时也显示所有目录或文件的总和。 |
-k或–kilobytes | 以KB(1024bytes)为单位输出。 |
-m或–megabytes | 以MB为单位输出。 |
-s或–summarize | 仅显示总计,只列出最后加总的值。 |
-h或–human-readable | 以K,M,G为单位,提高信息的可读性。 |
-x或–one-file-xystem | 以一开始处理时的文件系统为准,若遇上其它不同的文件系统目录则略过。 |
-L<符号链接>或–dereference<符号链接> | 显示选项中所指定符号链接的源文件大小。 |
-S或–separate-dirs | 显示个别目录的大小时,并不含其子目录的大小。 |
-X<文件>或–exclude-from=<文件> | 在<文件>指定目录或文件。 |
–exclude=<目录或文件> | 略过指定的目录或文件。 |
-D或–dereference-args | 显示指定符号链接的源文件大小。 |
-H或–si | 与-h参数相同,但是K,M,G是以1000为换算单位。 |
-l或–count-links | 重复计算硬件链接的文件。 |
使用实例:
显示当前目录或者文件所占空间
命令:
du
输出:
4 ./.IntelliJIdea14/system/compile-server/spark_test_2956500d/targets/flex
4 ./.IntelliJIdea14/system/compile-server/spark_test_2956500d/targets/flex-resource-production
4 ./.IntelliJIdea14/system/compile-server/spark_test_2956500d/targets/flex-resource-test
4 ./.IntelliJIdea14/system/compile-server/spark_test_2956500d/targets/gradle-resources-production
4 ./.IntelliJIdea14/system/compile-server/spark_test_2956500d/targets/gradle-resources-test
4 ./.IntelliJIdea14/system/compile-server/spark_test_2956500d/targets/gwt
84 ./.IntelliJIdea14/system/compile-server/spark_test_2956500d/targets/Java-production/spark_test/src-out
88 ./.IntelliJIdea14/system/compiler/accessmodifier.d136518b/.caches/jasper_validator
88 ./.IntelliJIdea14/system/compiler/accessmodifier.d136518b/.caches
10000 c:\user\zang
......
把当前目录下面所有的文件都列出来.
说明:
命令:
du
输出:
4 ./.IntelliJIdea14/system/compile-server/spark_test_2956500d/targets/flex
4 ./.IntelliJIdea14/system/compile-server/spark_test_2956500d/targets/flex-resource-production
4 ./.IntelliJIdea14/system/compile-server/spark_test_2956500d/targets/flex-resource-test
4 ./.IntelliJIdea14/system/compile-server/spark_test_2956500d/targets/gradle-resources-production
4 ./.IntelliJIdea14/system/compile-server/spark_test_2956500d/targets/gradle-resources-test
4 ./.IntelliJIdea14/system/compile-server/spark_test_2956500d/targets/gwt
84 ./.IntelliJIdea14/system/compile-server/spark_test_2956500d/targets/Java-production/spark_test/src-out
88 ./.IntelliJIdea14/system/compiler/accessmodifier.d136518b/.caches/jasper_validator
88 ./.IntelliJIdea14/system/compiler/accessmodifier.d136518b/.caches
10000 c:\user\zang
......
把当前目录下面所有的文件都列出来.
说明:
du
4 ./.IntelliJIdea14/system/compile-server/spark_test_2956500d/targets/flex
4 ./.IntelliJIdea14/system/compile-server/spark_test_2956500d/targets/flex-resource-production
4 ./.IntelliJIdea14/system/compile-server/spark_test_2956500d/targets/flex-resource-test
4 ./.IntelliJIdea14/system/compile-server/spark_test_2956500d/targets/gradle-resources-production
4 ./.IntelliJIdea14/system/compile-server/spark_test_2956500d/targets/gradle-resources-test
4 ./.IntelliJIdea14/system/compile-server/spark_test_2956500d/targets/gwt
84 ./.IntelliJIdea14/system/compile-server/spark_test_2956500d/targets/Java-production/spark_test/src-out
88 ./.IntelliJIdea14/system/compiler/accessmodifier.d136518b/.caches/jasper_validator
88 ./.IntelliJIdea14/system/compiler/accessmodifier.d136518b/.caches
10000 c:\user\zang
......
把当前目录下面所有的文件都列出来.
说明:
只显示当前目录下面的子目录的目录大小和当前目录的总的大小,最下面的10000为当前目录的总大小
显示指定文件所占空间
命令:
du file_name
输出:
$ du Untitled5.ipynb
4 Untitled5.ipynb
查看指定目录的所占空间
命令:
du path
输出:
8 perl5/lib/perl5/x86_64-linux-thread-multi/auto/Devel/StackTrace
12 perl5/lib/perl5/x86_64-linux-thread-multi/auto/Devel
4280 perl5/lib/perl5/x86_64-linux-thread-multi/auto
......
12 perl5/lib/perl5/Devel/StackTrace
32 perl5/lib/perl5/Devel
18632 perl5/lib/perl5
18636 perl5/lib
112 perl5/bin
30284 perl5
显示多个文件所占空间
命令:
du file1 file2
输出:
[root@master ~]# du anaconda-ks.cfg a.pl
4 anaconda-ks.cfg
4 a.pl
[root@master ~]#
只显示总和的大小
命令:
du -s
输出:
[root@master ~]# du -s
4110140 .
[root@master ~]#
方便阅读的格式显示
命令:
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
文件和目录都显示
命令:
du -ah test
输出:
[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
显示几个文件或目录各自占用磁盘空间的大小,还统计它们的总和
命令:
[root@master v2.0]# du -ch sorted_hsa_1132_isopiR.sta dre_58_isopiR_delEditing_sta.sta
输出:
[root@master v2.0]# du -ch sorted_hsa_1132_isopiR.sta dre_58_isopiR_delEditing_sta.sta
1.1G sorted_hsa_1132_isopiR.sta
718M dre_58_isopiR_delEditing_sta.sta
1.8G total
按照空间大小排序
命令:
du|sort -nr|more
du file_name
输出:
$ du Untitled5.ipynb
4 Untitled5.ipynb
查看指定目录的所占空间
命令:
du path
输出:
8 perl5/lib/perl5/x86_64-linux-thread-multi/auto/Devel/StackTrace
12 perl5/lib/perl5/x86_64-linux-thread-multi/auto/Devel
4280 perl5/lib/perl5/x86_64-linux-thread-multi/auto
......
12 perl5/lib/perl5/Devel/StackTrace
32 perl5/lib/perl5/Devel
18632 perl5/lib/perl5
18636 perl5/lib
112 perl5/bin
30284 perl5
显示多个文件所占空间
命令:
du file1 file2
输出:
[root@master ~]# du anaconda-ks.cfg a.pl
4 anaconda-ks.cfg
4 a.pl
[root@master ~]#
只显示总和的大小
命令:
du -s
输出:
[root@master ~]# du -s
4110140 .
[root@master ~]#
方便阅读的格式显示
命令:
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
文件和目录都显示
命令:
du -ah test
输出:
[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
显示几个文件或目录各自占用磁盘空间的大小,还统计它们的总和
命令:
[root@master v2.0]# du -ch sorted_hsa_1132_isopiR.sta dre_58_isopiR_delEditing_sta.sta
输出:
[root@master v2.0]# du -ch sorted_hsa_1132_isopiR.sta dre_58_isopiR_delEditing_sta.sta
1.1G sorted_hsa_1132_isopiR.sta
718M dre_58_isopiR_delEditing_sta.sta
1.8G total
按照空间大小排序
命令:
du|sort -nr|more
$ du Untitled5.ipynb
4 Untitled5.ipynb
命令:
du path
输出:
8 perl5/lib/perl5/x86_64-linux-thread-multi/auto/Devel/StackTrace
12 perl5/lib/perl5/x86_64-linux-thread-multi/auto/Devel
4280 perl5/lib/perl5/x86_64-linux-thread-multi/auto
......
12 perl5/lib/perl5/Devel/StackTrace
32 perl5/lib/perl5/Devel
18632 perl5/lib/perl5
18636 perl5/lib
112 perl5/bin
30284 perl5
显示多个文件所占空间
命令:
du file1 file2
输出:
[root@master ~]# du anaconda-ks.cfg a.pl
4 anaconda-ks.cfg
4 a.pl
[root@master ~]#
只显示总和的大小
命令:
du -s
输出:
[root@master ~]# du -s
4110140 .
[root@master ~]#
方便阅读的格式显示
命令:
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
文件和目录都显示
命令:
du -ah test
输出:
[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
显示几个文件或目录各自占用磁盘空间的大小,还统计它们的总和
命令:
[root@master v2.0]# du -ch sorted_hsa_1132_isopiR.sta dre_58_isopiR_delEditing_sta.sta
输出:
[root@master v2.0]# du -ch sorted_hsa_1132_isopiR.sta dre_58_isopiR_delEditing_sta.sta
1.1G sorted_hsa_1132_isopiR.sta
718M dre_58_isopiR_delEditing_sta.sta
1.8G total
按照空间大小排序
命令:
du|sort -nr|more
du path
8 perl5/lib/perl5/x86_64-linux-thread-multi/auto/Devel/StackTrace
12 perl5/lib/perl5/x86_64-linux-thread-multi/auto/Devel
4280 perl5/lib/perl5/x86_64-linux-thread-multi/auto
......
12 perl5/lib/perl5/Devel/StackTrace
32 perl5/lib/perl5/Devel
18632 perl5/lib/perl5
18636 perl5/lib
112 perl5/bin
30284 perl5
显示多个文件所占空间
命令:
du file1 file2
输出:
[root@master ~]# du anaconda-ks.cfg a.pl
4 anaconda-ks.cfg
4 a.pl
[root@master ~]#
只显示总和的大小
命令:
du -s
输出:
[root@master ~]# du -s
4110140 .
[root@master ~]#
方便阅读的格式显示
命令:
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
文件和目录都显示
命令:
du -ah test
输出:
[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
显示几个文件或目录各自占用磁盘空间的大小,还统计它们的总和
命令:
[root@master v2.0]# du -ch sorted_hsa_1132_isopiR.sta dre_58_isopiR_delEditing_sta.sta
输出:
[root@master v2.0]# du -ch sorted_hsa_1132_isopiR.sta dre_58_isopiR_delEditing_sta.sta
1.1G sorted_hsa_1132_isopiR.sta
718M dre_58_isopiR_delEditing_sta.sta
1.8G total
按照空间大小排序
命令:
du|sort -nr|more
du file1 file2
输出:
[root@master ~]# du anaconda-ks.cfg a.pl
4 anaconda-ks.cfg
4 a.pl
[root@master ~]#
只显示总和的大小
命令:
du -s
输出:
[root@master ~]# du -s
4110140 .
[root@master ~]#
方便阅读的格式显示
命令:
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
文件和目录都显示
命令:
du -ah test
输出:
[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
显示几个文件或目录各自占用磁盘空间的大小,还统计它们的总和
命令:
[root@master v2.0]# du -ch sorted_hsa_1132_isopiR.sta dre_58_isopiR_delEditing_sta.sta
输出:
[root@master v2.0]# du -ch sorted_hsa_1132_isopiR.sta dre_58_isopiR_delEditing_sta.sta
1.1G sorted_hsa_1132_isopiR.sta
718M dre_58_isopiR_delEditing_sta.sta
1.8G total
按照空间大小排序
命令:
du|sort -nr|more
[root@master ~]# du anaconda-ks.cfg a.pl
4 anaconda-ks.cfg
4 a.pl
[root@master ~]#
命令:
du -s
输出:
[root@master ~]# du -s
4110140 .
[root@master ~]#
方便阅读的格式显示
命令:
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
文件和目录都显示
命令:
du -ah test
输出:
[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
显示几个文件或目录各自占用磁盘空间的大小,还统计它们的总和
命令:
[root@master v2.0]# du -ch sorted_hsa_1132_isopiR.sta dre_58_isopiR_delEditing_sta.sta
输出:
[root@master v2.0]# du -ch sorted_hsa_1132_isopiR.sta dre_58_isopiR_delEditing_sta.sta
1.1G sorted_hsa_1132_isopiR.sta
718M dre_58_isopiR_delEditing_sta.sta
1.8G total
按照空间大小排序
命令:
du|sort -nr|more
du -s
[root@master ~]# du -s
4110140 .
[root@master ~]#
方便阅读的格式显示
命令:
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
文件和目录都显示
命令:
du -ah test
输出:
[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
显示几个文件或目录各自占用磁盘空间的大小,还统计它们的总和
命令:
[root@master v2.0]# du -ch sorted_hsa_1132_isopiR.sta dre_58_isopiR_delEditing_sta.sta
输出:
[root@master v2.0]# du -ch sorted_hsa_1132_isopiR.sta dre_58_isopiR_delEditing_sta.sta
1.1G sorted_hsa_1132_isopiR.sta
718M dre_58_isopiR_delEditing_sta.sta
1.8G total
按照空间大小排序
命令:
du|sort -nr|more
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
文件和目录都显示
命令:
du -ah test
输出:
[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
显示几个文件或目录各自占用磁盘空间的大小,还统计它们的总和
命令:
[root@master v2.0]# du -ch sorted_hsa_1132_isopiR.sta dre_58_isopiR_delEditing_sta.sta
输出:
[root@master v2.0]# du -ch sorted_hsa_1132_isopiR.sta dre_58_isopiR_delEditing_sta.sta
1.1G sorted_hsa_1132_isopiR.sta
718M dre_58_isopiR_delEditing_sta.sta
1.8G total
按照空间大小排序
命令:
du|sort -nr|more
[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
命令:
du -ah test
输出:
[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
显示几个文件或目录各自占用磁盘空间的大小,还统计它们的总和
命令:
[root@master v2.0]# du -ch sorted_hsa_1132_isopiR.sta dre_58_isopiR_delEditing_sta.sta
输出:
[root@master v2.0]# du -ch sorted_hsa_1132_isopiR.sta dre_58_isopiR_delEditing_sta.sta
1.1G sorted_hsa_1132_isopiR.sta
718M dre_58_isopiR_delEditing_sta.sta
1.8G total
按照空间大小排序
命令:
du|sort -nr|more
du -ah test
[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
显示几个文件或目录各自占用磁盘空间的大小,还统计它们的总和
命令:
[root@master v2.0]# du -ch sorted_hsa_1132_isopiR.sta dre_58_isopiR_delEditing_sta.sta
输出:
[root@master v2.0]# du -ch sorted_hsa_1132_isopiR.sta dre_58_isopiR_delEditing_sta.sta
1.1G sorted_hsa_1132_isopiR.sta
718M dre_58_isopiR_delEditing_sta.sta
1.8G total
按照空间大小排序
命令:
du|sort -nr|more
[root@master v2.0]# du -ch sorted_hsa_1132_isopiR.sta dre_58_isopiR_delEditing_sta.sta
输出:
[root@master v2.0]# du -ch sorted_hsa_1132_isopiR.sta dre_58_isopiR_delEditing_sta.sta
1.1G sorted_hsa_1132_isopiR.sta
718M dre_58_isopiR_delEditing_sta.sta
1.8G total
按照空间大小排序
命令:
du|sort -nr|more
[root@master v2.0]# du -ch sorted_hsa_1132_isopiR.sta dre_58_isopiR_delEditing_sta.sta
1.1G sorted_hsa_1132_isopiR.sta
718M dre_58_isopiR_delEditing_sta.sta
1.8G total
命令:
du|sort -nr|more
du|sort -nr|more
输出:
[root@localhost test]# du|sort -nr|more
1288 .
608 ./test6
308 ./test4
32 ./scf
16 ./scf/service
12 ./scf/service/deploy
8 ./test3
4 ./scf/service/deploy/product
4 ./scf/service/deploy/info
4 ./scf/lib
4 ./scf/doc
4 ./scf/bin
[root@localhost test]#
输出当前目录下各个子目录所使用的空间
命令:
du -h --max-depth=1
输出:
[root@localhost test]# du -h --max-depth=1
608K ./test6
308K ./test4
32K ./scf
8.0K ./test3
1.3M .
[root@localhost test]#
du -h --max-depth=1
输出:
[root@localhost test]# du -h --max-depth=1
608K ./test6
308K ./test4
32K ./scf
8.0K ./test3
1.3M .
[root@localhost test]#
[root@localhost test]# du -h --max-depth=1
608K ./test6
308K ./test4
32K ./scf
8.0K ./test3
1.3M .
[root@localhost test]#
本文永久更新链接地址:http://www.linuxidc.com/Linux/2017-06/144944.htm