• du
  • Du命令

    du

    统计磁盘空间使用情况 -a 显示所有文件大小 -h 以人类可读的方式查看大小 -s 显示文件的总大小 --exclude=<目录或文件> 略过指定的目录或文件 -X --exclude-from=FILE 从文件读取所需要略过的目录或者文件 --max-depth=N 显示n级子目录的大小

     ~/Downloads  ll
    total 155800
    drwxr-xr-x  3 andy root     4096 7月  14 08:06 .
    drwx------ 59 andy root    20480 7月  16 21:57 ..
    -rw-r--r--  1 andy root 16390144 6月  29 22:30 GoodBooks.xls
    -rw-r--r--  1 andy root  4727681 2月  18 18:30 Highstock-8.0.0.zip
    drwxr-xr-x  3 andy root     4096 1月  31 15:26 jetbrains-agent
    -rw-r--r--  1 andy root    48584 7月  12 22:33 nautilus_nutstore_amd64.deb
    -rw-r--r--  1 andy root 80973216 2月   8 09:44 Postman-linux-x64-7.17.0.tar.gz
    -rw-r--r--  1 andy root 57316272 7月   5 21:26 Programming+Ruby中文版++(第二版).pdf
     ~/Downloads  du -a 
    4628    ./Highstock-8.0.0.zip
    56  ./nautilus_nutstore_amd64.deb
    16016   ./GoodBooks.xls
    55984   ./Programming+Ruby中文版++(第二版).pdf
    68  ./jetbrains-agent/javaagent_sample.png
    12  ./jetbrains-agent/sha1sum.txt
    12  ./jetbrains-agent/important.txt
    12  ./jetbrains-agent/ACTIVATION_CODE.txt
    116 ./jetbrains-agent/docs/YA_README.pdf
    16  ./jetbrains-agent/docs/README.txt
    128 ./jetbrains-agent/docs/README.pdf
    12  ./jetbrains-agent/docs/YA_README.txt
    276 ./jetbrains-agent/docs
    2204    ./jetbrains-agent/jetbrains-agent.jar
    28  ./jetbrains-agent/LICENSE
    2616    ./jetbrains-agent
    79088   ./Postman-linux-x64-7.17.0.tar.gz
    158392  .
     ~/Downloads  du -h
    276K    ./jetbrains-agent/docs
    2.6M    ./jetbrains-agent
    155M    .
    ~/Downloads  du --exclude=jetbrains-agent -a
    4628    ./Highstock-8.0.0.zip
    56  ./nautilus_nutstore_amd64.deb
    16016   ./GoodBooks.xls
    55984   ./Programming+Ruby中文版++(第二版).pdf
    79088   ./Postman-linux-x64-7.17.0.tar.gz
    155776  .
    

    上一篇:Stat命令

    下一篇:Watch 命令