Created
July 24, 2020 14:39
-
-
Save richardkalehoff/83d2731a8c08b65c026c6bac7c8f38d0 to your computer and use it in GitHub Desktop.
Find and delete node_modules directories.
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
# List all node_modules in a directory and all descendant directories | |
$ find . -name "node_modules" -type d -prune | xargs du -chs | |
# Delete all node_modules in a directory and all descendant directories | |
$ find . -name "node_modules" -type d -prune -exec rm -rf '{}' + |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Taken from here: https://trilon.io/blog/how-to-delete-all-nodemodules-recursively