### Delete `node_modules` recursively ```fish cd directory-to-prune # delete all node_modules in a single rm command find . -name 'node_modules' -type d -prune -exec rm -rf '{}' + # or delete folders one by one printing the folder being deleted find . -name 'node_modules' -type d -prune -print -exec rm -rf '{}' \; ``` > `-prune` will prevent **find** to recurse into `node_module` directories (to look for nested `node_modules`) > `{}` is a placeholder which **find** replaces with the file path it found. > `+` tells **find** to append all the file paths to a single command rather than running `rm` for each. ### Interactive mode > https://github.com/voidcosmos/npkill ```fish cd directory-to-prune npx npkill ```