Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
Working!

John Bennett johnb85022

💭
Working!
  • Phoenix Arizona
View GitHub Profile
@joostvanveen
joostvanveen / du.sh
Last active Feb 22, 2022
Get folder sizes on command line, including --max-depth, sorted by folder size desc
View du.sh
# Get available disk space
df -h
# Get the top 10 biggest folders in the current directory
du -h --max-depth=1 | sort -rh | head -10
# Get the top 10 biggest folders in the current directory and their first child directories
du -h --max-depth=2 | sort -rh | head -10
# Get sizes of all folders in the current directory