Skip to content

Instantly share code, notes, and snippets.

@richardkalehoff
Created July 24, 2020 14:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save richardkalehoff/83d2731a8c08b65c026c6bac7c8f38d0 to your computer and use it in GitHub Desktop.
Save richardkalehoff/83d2731a8c08b65c026c6bac7c8f38d0 to your computer and use it in GitHub Desktop.
Find and delete node_modules directories.
# List all node_modules in a directory and all descendant directories
$ find . -name "node_modules" -type d -prune | xargs du -chs
# Delete all node_modules in a directory and all descendant directories
$ find . -name "node_modules" -type d -prune -exec rm -rf '{}' +
@richardkalehoff
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment