Created
February 11, 2019 18:17
-
-
Save AnsonT/a952efcb10883651af9bc51cfff92797 to your computer and use it in GitHub Desktop.
Displaying directory sizes (e.g. .git, node_modules, etc)
This file contains hidden or 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 dir_sizes() { | |
find $1 -type d -name $2 -prune | while read line; do du -sh $line; done | |
} | |
alias ds=dir_sizes # ds {start_dir} {name_pattern} | |
# e.g. list node_modules sizes recursively | |
# ds . node_modules | |
# | |
# output: | |
# 584k ./project1/node_modules | |
# 211k ./project2/node_modules | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment