Skip to content

Instantly share code, notes, and snippets.

@anhtuank7c
Created January 7, 2023 10:41
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Embed
What would you like to do?
[Mac/Linux] List and remove all the node_modules at the current directory
#!/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