Skip to content

Instantly share code, notes, and snippets.

@mikecabana
Created August 11, 2020 21:23
Show Gist options
  • Save mikecabana/5514f02eda74626f4e3f57cc1c38cccf to your computer and use it in GitHub Desktop.
Save mikecabana/5514f02eda74626f4e3f57cc1c38cccf to your computer and use it in GitHub Desktop.
Remove recursively node_modules folders on Mac/Linux machines
# Mac/Linux Terminal
# List all node_modules folders in a directory
find . -name "node_modules" -type d -prune -print | xargs du -chs
# Delete all node_modules folders in a 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