How to sort the result of du -h command
To sort the result of “du -h” command, you can use
1 |
du -h --max-depth=1 | sort -h |
If you want to list files in current files also, you can use
1 |
du -ah --max-depth=1 | sort -h |
If you want to display files in KB, you can use
1 |
du -k --max-depth=1 | sort -n |
Back to Disk Usage