Created
October 13, 2017 15:50
-
-
Save pepijnblom/98df27f894c373d3436b0ac7277f4daa to your computer and use it in GitHub Desktop.
Largest file/dir bash
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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}'|grep -v ^0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment