Skip to content

Linux disk visualization tool - ncdu

磁盘空间快满的时候快速查找某个目录占用空间大。

ncdu /var

(分析后按左右键查看即可)

ncdu 1.15.1 ~ Use the arrow keys to navigate, press ? for help                                                                                                           
--- /var -------------------------------------
  492.0 MiB [##########] /crash
  165.4 MiB [###       ] /lib
   62.6 MiB [#         ] /cache
   46.9 MiB [          ] /opt
   20.1 MiB [          ] /log
  440.0 KiB [          ] /spool
   20.0 KiB [          ] /tmp
   12.0 KiB [          ] /kerberos
   12.0 KiB [          ] /db
    8.0 KiB [          ] /empty
e   4.0 KiB [          ] /yp
e   4.0 KiB [          ] /preserve
e   4.0 KiB [          ] /nis
e   4.0 KiB [          ] /local
e   4.0 KiB [          ] /gopher
e   4.0 KiB [          ] /games
e   4.0 KiB [          ] /ftp
e   4.0 KiB [          ] /adm
    4.0 KiB [          ]  .updated
@   0.0   B [          ]  lock
@   0.0   B [          ]  mail
@   0.0   B [          ]  run

Further reading

  • du counting hardlinks towards filesize(https://stackoverflow.com/questions/19951883/du-counting-hardlinks-towards-filesize)

Disclaimer
  1. License under CC BY-NC 4.0
  2. Copyright issue feedback me#imzye.me, replace # with @
  3. Not all the commands and scripts are tested in production environment, use at your own risk
  4. No privacy information is collected here
Try iOS App