Terminal - Diagnosing Disk Usage

Today, one of my drives filled up completely to the point where the system could not even update the log files whenever I logged in. The following command helps you easily diagnose your disk usage by listing the the folders in your current directory in order of size.

du --max-depth=1 . | sort -n -r
To get the results in human readable form, adding -h after du will output G, M, K but will prevent the sorting algorithm from working.

No comments:

Post a Comment