Last active
December 20, 2015 13:49
-
-
Save spicyjack/6141613 to your computer and use it in GitHub Desktop.
Shell function to find the "pigs", or large directories underneath the current directory, or a directory of your choice
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
function pigfind { | |
if [ "x$1" != "x" ]; then | |
FIND_PATH="$1" | |
else | |
FIND_PATH="." | |
fi | |
find $FIND_PATH -maxdepth 1 -type d -exec du -sh '{}' \; 2>/dev/null \ | |
| sort -h | |
} # get the sizes of the subdirectories of $PWD, sort from smallest to largest |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment