Skip to content

Instantly share code, notes, and snippets.

@josephgoksu
Last active July 6, 2022 15:29
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 josephgoksu/49039a0a7b6babb73811acb47133e31b to your computer and use it in GitHub Desktop.
Save josephgoksu/49039a0a7b6babb73811acb47133e31b to your computer and use it in GitHub Desktop.
Delete node_modules folder recursively from a specified path using command line

Delete node_modules folder recursively from a specified path using command line

Print out a list of directories to be deleted:

$ find . -name 'node_modules' -type d -prune

Delete directories from the current working directory:

$ find . -name 'node_modules' -type d -prune -exec rm -rf '{}' +

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