Created
October 30, 2018 10:49
-
-
Save BigglesZX/e52caffcff09663337c33bd7d7bfd144 to your computer and use it in GitHub Desktop.
Find and sort node_modules folders by size, to aid pruning
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
find . -type d -name "node_modules" -prune -exec du -sh {} \; | sort -nrk1 | |
# find directories matching the name `node_modules` | |
# prune out unnecessary entries from within top-level `node_modules` results | |
# run `du` against the results to calculate size | |
# pipe to sort, first column as key, reverse natural |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment