Remove Duplicates in Linux1 min read
I knew I could use fdupes to identify the dupes, but I wanted to replace them with hardlinks. I’ve seen many bash scripts that pipe the output from fdupes -r to view them. On newer distros, Ubuntu 12.04, fdupes has a -L option that will replace the duplicates with hardlinks.
apt-get install fdupes
fdupes -r -L /marketing
On older versions of Ubuntu 10.04 the -L option does not exist. I grabbed and compiled a newer version of fdupes from this repository to support the -L option.