Last active
April 10, 2023 11:45
-
-
Save cusspvz/f69e0c42b6bfe7e9bbec25dcf7d69352 to your computer and use it in GitHub Desktop.
Delete all node_modules folders RECURSIVELY
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
#!/bin/bash | |
# this command finds all the `node_modules` folders under your current path and will prune them | |
find . | grep /node_modules$ | grep -v /node_modules/ | xargs rm -fR |
I ran it and it deleted critical files from my OS...
just kidding, but if you are stupid and haven't commit everything before do a dry run (removing the xargs rm -fR part) to check what is going to delete
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Just used this today, worked like a charm.