Skip to content

Instantly share code, notes, and snippets.

@BigglesZX
Created October 30, 2018 10:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save BigglesZX/e52caffcff09663337c33bd7d7bfd144 to your computer and use it in GitHub Desktop.
Save BigglesZX/e52caffcff09663337c33bd7d7bfd144 to your computer and use it in GitHub Desktop.
Find and sort node_modules folders by size, to aid pruning
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