linux命令学习-- du

156 阅读1分钟
  1. 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的总的统计
    
    
  2. 命令截图

du -sh /Users/dingyawu/mycoderepo

image.png

image.png

du -sh /Users/dingyawu/mycoderepo/test-springboot.zip

image.png

cd  /Users/dingyawu/mycoderepo 、 du -sh

image.png