Almost all my professional and personal projects end up in my
$HOME/work directory. In the last year, I also did a lot of small contributions to many open source projects and my
$HOME/work directory is becoming big, around 400Gb. Time for some spring cleaning!
The first step was to delete projects I wasn’t contributing anymore, making sure that I submitted my pull requests or at least pushed my branches to my fork.
I don’t want to archive my personal projects (open source or not), because there is often a time when I have to pick up an idea, a library or have a look at an implementation 1. So I ended up running a few housekeeping commands:
- git garbage collect all the things 🧹
$ find ~/work -iname ".git" -type d \ | sed "s/\.git//" \ | xargs -I % sh -c "cd % && git gc --aggressive"
- delete all the
$ find ~/work -iname "build" -or -name "node_modules" -type d \ | xargs rm -rf
- delete all the .o files
$ find ~/work -iname "*.o" -type f | xargs rm -f
After these steps, I now have a more manageable 97Gb work directory; I know that I’ll have to
yarn install and
make a few things though.