Linux查看文件夹大小

Linux查看文件夹大小

du -sh 查看当前文件夹大小

du -sh * | sort -n 统计当前文件夹(目录)大小,并按文件大小排序

附送:

du -sk filename 查看指定文件大小

 

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

Linux:ls以K、M、G为单位查看文件大小。
#man ls
……
-h, --human-readable
print sizes in human readable format (e.g., 1K 234M 2G)
……
# ls
cuss.war nohup.out
# ls -l
total 30372
-rw-r--r-- 1 root root 31051909 May 24 10:07 cuss.war
-rw------- 1 root root 0 Mar 20 13:52 nohup.out
# 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
# ll -h
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

[root@localhost rice_f2]# 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
371M -rw-r--r-- 1 root root 371M 06-03 18:06 1.fa
360M -rw-r--r-- 1 root root 359M 06-03 18:07 2.fna
8.0K drwxr-xr-x 2 root root 4.0K 06-03 19:13 lane
 24K drwxr-xr-x 2 root root  20K 06-04 15:03 111
3.1G -rw-r--r-- 1 root root 3.1G 06-04 15:32 sample1.txt
2.4G -rw-r--r-- 1 root root 2.4G 06-04 15:53 sample2.txt
1.4G -rw-r--r-- 1 root root 1.4G 06-04 16:11 sample3.txt
1.3G -rw-r--r-- 1 root root 1.3G 06-04 16:11 sample4.txt
4.2G -rw-r--r-- 1 root root 4.2G 06-04 14:51 22222.txt

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值