Skip to content

Instantly share code, notes, and snippets.

@vanduc1102
Last active August 3, 2024 08:57
Show Gist options
  • Save vanduc1102/1557fa4f70ea01fc49eac8e295b3fe37 to your computer and use it in GitHub Desktop.
Save vanduc1102/1557fa4f70ea01fc49eac8e295b3fe37 to your computer and use it in GitHub Desktop.
MacOS cleanup folders before backup commands

Show folder size

du -hs ~/workspace

Remove folders rescurisvely

cd ~/workspace;

find . -name 'node_modules' -type d -prune -print -exec rm -rf '{}' \;
find . -name '__generated__' -type d -prune -print -exec rm -rf '{}' \;
find . -name '.turbo' -type d -prune -print -exec rm -rf '{}' \;
find . -name '.next' -type d -prune -print -exec rm -rf '{}' \;
find . -name 'dist' -type d -prune -print -exec rm -rf '{}' \;

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