Skip to content

Instantly share code, notes, and snippets.

@kylejeske
Forked from billsinc/gist:4665346
Created December 4, 2019 15:06
Show Gist options
  • Save kylejeske/742775c9e259469f09582c2834ea3f53 to your computer and use it in GitHub Desktop.
Save kylejeske/742775c9e259469f09582c2834ea3f53 to your computer and use it in GitHub Desktop.
Find Largest Files/Directories on Linux System
# 10 Largest Files
find . -type f -print0 | xargs -0 du -s | sort -n | tail -10 | cut -f2 | xargs -I{} du -sh {}
# 10 Largest Directories
find . -type d -print0 | xargs -0 du -s | sort -n | tail -10 | cut -f2 | xargs -I{} du -sh {}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment