linux poison RSS
linux poison Email

Find and Delete Duplicate files under Linux - Fdupes

fdupes is a program written by Adrian Lopez to scan directories for duplicate files, with options to list and delete them. It first compares file sizes and MD5 signatures, and then performs a byte-by-byte check for verification.
fdupes is written in C and is released under the MIT License.

fdupes installation:
Type the following command to install fdupes in Debian / Ubuntu Linux:
sudo apt-get install fdupes

Using fdupes:To find duplicate files in /etc/ directory, run :
sudo fdupes /etc/

You can recursively search every directory given follow sub-directories encountered within the -r option:
sudo fdupes -r /etc
Deleting duplicate files using fdupes:
sudo fdupes -d /etc/
[1] /etc/.pwd.lock                     
[2] /etc/mtab.fuselock
Set 1 of 2, preserve files [1 - 2, all]:
If fdupes returns with an error message such as fdupes: error invoking md5sum it means the program has been compiled to use an external program to calculate MD5 signatures (otherwise, fdupes uses interal routines for this purpose), and an error has occurred while attempting to execute it.

If this is the case, the specified program should be properly installed prior to running fdupes.
When using -d or --delete, care should be taken to insure against accidental data loss.


Post a Comment

Related Posts with Thumbnails