Skip to content

Instantly share code, notes, and snippets.

@valk
Forked from antespi/HowTo: Sorted disk usage (du)
Created December 6, 2020 15:06
Show Gist options
  • Save valk/d90c18193585e422a290149658dd598f to your computer and use it in GitHub Desktop.
Save valk/d90c18193585e422a290149658dd598f to your computer and use it in GitHub Desktop.
List first level directories inside a directory, sorted by size. Useful when your disk is full and you are searching something to erase or move elsewhere.
du -k -d1 * | sort -nr | cut -f2 | xargs -d '\n' du -sh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment