Last active
January 18, 2021 08:22
-
-
Save andyford/fb59f34e4846e828a86b073a97647d11 to your computer and use it in GitHub Desktop.
find and delete all node_modules directories
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
| # see: https://trilon.io/blog/how-to-delete-all-nodemodules-recursively | |
| # you probably don't want to run this against your ENTIRE system | |
| # your user directory might be more appropriate | |
| # cd ~ | |
| # finds all node_module directories and prints their path and size | |
| # find . -name "node_modules" -type d -prune -print | xargs du -chs | |
| # finds and recursively deletes all node_module directories | |
| # find . -name 'node_modules' -type d -prune -print -exec rm -rf '{}' \; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment