Find duplicates in a folder and convert them to symlinks
Hi,
Duplicate files waste precious space on your computer’s hard drive.
Here a terminal approach with a script to vonvert them to symlinks:
first install the dependencies:
sudo apt-get install rdfind symlinks
Now create the blxremoveduplicates script:
#!/bin/bash
if [[ -d "$1" && ! -L "$1" ]] ; then
rdfind -makesymlinks true $1
symlinks -crs $1
else
echo "Enter a valid directory name!"
fi
USAGE : ./blxremoveduplicates folder_name
You can „compile“ it with shc and place it in the /usr/bin folder after that.
if you know that your directory contains broken symlinks use this script instead:
#!/bin/bash
if [[ -d "$1" && ! -L "$1" ]] ; then
find -L $1 -type l -delete
rdfind -makesymlinks true $1
symlinks -crs $1
else
echo "Enter a valid directory name!"
fi
Another method:
source: http://www.howtogeek.com/201167/how-to-find-and-remove-duplicate-files-on-any-operating-system/
You can install this with:
sudo apt-get install fslint
start it with: fslint-gui
Fslint is a bit easier to use but i do see that it fails very often and the method is nor so stable as my command line approach, but perhaps you`ll like fslint more, so i posted it here too.
Hope this tutorial it helped someone.