Go – Finding and removing duplicate files on a Mac

My laptop’s hard drive is plagued with the same family pics stored in different folders. So, I wrote a simple app in Go to take care of this for me. The app does this by comparing MD5 hashes of files.


Assuming you saved the code in a file called main.go, here is how you can use it to find duplicate files:

This will print duplicate files to the terminal. I added the flag -dupe_action=sym flag in the app which will sym-link all duplicates to one file.