-
du命令
全称:disk usage ,用于显示目录或文件的大小 du -sh /Users/dingyawu/mycoderepo :直接显示这个目录的大小 du -sh /Users/dingyawu/mycoderepo * :直接显示这个目录下所有目录的大小 du -sh /Users/dingyawu/mycoderepo/test-springboot.zip :直接展示一个文件的大小 du -sh *| sort -rh :查看一个目录下的所有文件夹(包括文件)的大小并且排序 -s或--summarize 仅显示总计 -h或--human-readable 以K,M,G为单位,提高信息的可读性 -c 增加total的总的统计 -
命令截图
du -sh /Users/dingyawu/mycoderepo
du -sh /Users/dingyawu/mycoderepo/test-springboot.zip
cd /Users/dingyawu/mycoderepo 、 du -sh