linux路径下文件夹大小排序,linux之在当前目录下按照文件大小进行排序的三种方法...

当前目录下按照文件大小排序

[root@test23 script]# ls -lSh

总用量 44K

-rw-r--r-- 1 root root 2.4K 12月 8 17:24 test.conf

-rw-r--r-- 1 root root 1.3K 11月 30 16:05 count_pig.sh

-rw-r--r-- 1 root root 1.3K 12月 21 20:31 count_pig.sh.bak

-rw-r--r-- 1 root root 1.2K 1月 24 15:18 get_holiday.sh

-rw-r--r-- 1 root root 853 12月 6 12:23 two_points.sh

-rw-r--r-- 1 root root 817 1月 24 14:55 holiday.txt

-rw-r--r-- 1 root root 458 1月 25 19:52 create_passwd.sh

-rw-r--r-- 1 root root 134 12月 18 16:44 all.sh

-rw-r--r-- 1 root root 119 12月 18 16:56 99.sh

-rw-r--r-- 1 root root 96 12月 8 15:02 test.php

-rw-r--r-- 1 root root 38 12月 1 10:44 test.sh

-rw-r--r-- 1 root root 0 1月 24 00:00 tempfile

1) ls

[root@test23 script]# ls -Sh

test.conf count_pig.sh.bak two_points.sh create_passwd.sh 99.sh test.sh

count_pig.sh get_holiday.sh holiday.txt all.sh test.php tempfile

2) find

[root@test23 script]# find ./ -type f -printf '%s %p\n' | sort -rn

2443 ./test.conf

1318 ./count_pig.sh.bak

1318 ./count_pig.sh

1180 ./get_holiday.sh

853 ./two_points.sh

817 ./holiday.txt

458 ./create_passwd.sh

134 ./all.sh

119 ./99.sh

96 ./test.php

38 ./test.sh

0 ./tempfile

3) du

[root@test23 script]# du -b * | sort -nr

2443 test.conf

1318 count_pig.sh.bak

1318 count_pig.sh

1180 get_holiday.sh

853 two_points.sh

817 holiday.txt

458 create_passwd.sh

134 all.sh

119 99.sh

96 test.php

38 test.sh

0 tempfile

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值