Thursday, January 9, 2020

Delete all node_modules folders recursively

In bash

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

Delete
find . -name 'node_modules' -type d -prune -print -exec rm -rf '{}' \;

Delete all bin/package folders

List:
find . -path "*/bin/package" -type d

Delete
find . -path "*/bin/package" -type d -prune -print -exec rm -rf '{}' \;

No comments:

Post a Comment