linux查看文件多大,linux查看当前文件和文件夹大小

Linux查看文件和文件夹大小

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

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

附送:

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

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

#ls -lhs

举例比较:

# 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

# 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

    原文作者:好荐的鱼爸
    原文地址: https://blog.csdn.net/weixin_29323493/article/details/116543954
    本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系博主进行删除。
点赞