Created
September 28, 2017 21:20
-
-
Save jehna/c89cb7eb7ec1e8a7cf15cde39a0b50b3 to your computer and use it in GitHub Desktop.
Free up disk space by removing node_modules
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
# Check how much space you would save by removing all node_modules folders under this folder | |
find . -regex '.*/node_modules$' -type d | grep -v 'node_modules/' | xargs du -ch | tail -1 |
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
# Remove all node_modules folders found inside this directory | |
# Thank you for @lehtu for the original script | |
find . -regex '.*/node_modules$' -type d | grep -v 'node_modules/' | xargs rm -r |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment