<Marc Qualie/>

Cleanup dev resources

When working on a bunch of development projects, specifically JavaScript, drives can fill up pretty fast with useless data. The most common is the well known node_modules which can take multiple gigabytes on some projects. Unless you're working on these day to day, it can be a good idea to mass clear them out.

Find all node_modules

Assuming your code is stored in ~/src:

find ~/src -name "node_modules" -type d -prune | tr \\n \\0 | xargs -0 du -chs

Delete all resources

Make sure to check the paths above, the following command is not reversible:

find ~/src -name 'node_modules' -type d -prune -print -exec rm -rf '{}' \;

Other directories

As well as node_modules, there are other folders that can build up over time.

If you have any questions about this post, or anything else, you can get in touch on Twitter or browse my code on Github.