Sorting disk usage by folder in Linux
Normally you would use something like this: du -k | sort -nr > sorted.txt But the output is not pretty since we don’t like counting bytes. This will sort it in human readable format: du -k | sort -nr | awk ‘ BEGIN { split(“KB,MB,GB,TB”, Units, “,”); } { u = 1; while ($1 >= […]