Skip to content

Instantly share code, notes, and snippets.

@liuggio
Created November 26, 2013 13:59
Show Gist options
  • Save liuggio/7658669 to your computer and use it in GitHub Desktop.
Save liuggio/7658669 to your computer and use it in GitHub Desktop.
largest files and directories
FS='/';NUMRESULTS=20;resize;clear;date;df -h $FS; echo "Largest Directories:"; du -x $FS 2>/dev/null| sort -rnk1| head -n $NUMRESULTS| awk '{printf "%d MB %s\n", $1/1024,$2}';echo "Largest Files:"; nice -n 19 find $FS -mount -type f -ls 2>/dev/null| sort -rnk7| head -n $NUMRESULTS|awk '{printf "%d MB\t%s\n",($7/1024)/1024,$NF}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment