Linux列出10大最占系統資源的檔案與資料夾

# du -a /var | sort -n -r | head -n 10

-a : Include all files, not just directories (du command)
-h : Human readable format
-n : Numeric sort (sort command)
-r : Reverse the result of comparisons (sort command)
-n 10 : Display 10 largest file. If you want 20 largest file replace 10 with 20. (head command)