Skip to content

Instantly share code, notes, and snippets.

@webrgp
Last active October 15, 2024 12:47
Show Gist options
  • Save webrgp/90ef80236d2ce1da1f5062857d097423 to your computer and use it in GitHub Desktop.
Save webrgp/90ef80236d2ce1da1f5062857d097423 to your computer and use it in GitHub Desktop.
Recursive Package Pruner

Prune ALL node_modules in directory recursively:

# List all node_modules
find . -name "node_modules" -type d -prune | xargs du -chs

# Prune all node_modules
find . -name "node_modules" -type d -prune -exec rm -rf '{}' +

Prune ALL vendor in directory recursively:

# List all vendor
find . -name "vendor" -type d -prune | xargs du -chs

# Prune all vendor
find . -name "vendor" -type d -prune -exec rm -rf '{}' +
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment