Created
January 7, 2023 10:41
-
-
Save anhtuank7c/07087aa6470e910a6c7d9a58abf6c308 to your computer and use it in GitHub Desktop.
[Mac/Linux] List and remove all the node_modules at the current directory
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 | |
# Cleanup node_modules | |
echo "Calculate disk space for node_modules in all directory" | |
find . -name "node_modules" -type d -prune -print | xargs du -chs | |
echo "Remove all node_modules directory" | |
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