Linux查看文件和文件夹大小

来源:互联网 发布:利郎皮带淘宝 编辑:程序博客网 时间:2024/05/20 16:39

1  查看当前文件夹大小并排序

du -sh *|sort -n

du -sk filename 指定文件

Linux:ls以K、M、G为单位查看文件大小

$ ls -l

总用量 104
drwxr-x---  19 back1 db2grp1 4096 11月  3 13:07 batch
drwxr-xr-x   5 back1 db2grp1 4096 11月  3 13:25 bccbin
drwxr-xr-x  13 back1 db2grp1 4096 11月  3 13:25 busipub
-rw-r-----   1 back1 db2grp1 1022 11月  4 17:56 bxffscs.h
drwxr-xr-x   5 back1 db2grp1 4096 2015-01-21  common_unit
drwxr-xr-x   3 back1 db2grp1 4096 2015-01-21  db
drwxr-xr-x  15 back1 db2grp1 4096 11月  3 13:23 init
drwxr-xr-x   5 back1 db2grp1 4096 2015-01-21  kssbmp
drwxr-x---   5 back1 db2grp1 4096 11月  3 13:22 kssoc
drwxr-xr-x   8 back1 db2grp1 4096 11月  3 12:54 lib
drwxr-xr-x   2 back1 db2grp1 4096  7月 28 05:45 make
-rw-r-----   1 back1 db2grp1 1034 11月  4 17:56 pxffscs.h
drwxr-xr-x   2 back1 db2grp1 4096 11月  3 13:22 table

$ ls -lh

total 30M
-rw-r--r-- 1 root root 30M May 24 10:07 cuss.war
-rw------- 1 root root 0 Mar 20 13:52 nohup.out

# ls -lhs

总计 28G
15G -rw-r--r-- 1 root root 15G 06-04 14:35 all.txt
8.0K -rwx--x--x 1 root root 632 06-04 15:57 hash.pl






0 0