How to find and delete duplicate files in Linux: FSlint
Hello everyone, today we will learn how to find and delete duplicate files on a Linux PC or server. Here is a tool you can use as needed.
Whether you are using a Linux desktop or server, there are some good tools that can help you scan duplicate files in the system and delete them to free up space. The GUI and command line interface are available. Duplicate files are unnecessary waste of disk space. After all, if you really need to share the same file in different locations, you can use soft links or hard links to store data in one disk.
FSlint
FSlint is available in binary repositories of different Linux distributions, including Ubuntu, Debian, Fedora, and Red Hat. You only need to run your package manager and install the "fslint" package. By default, this tool provides a simple graphical interface with command line versions that also contain various features.
Do not worry that the graphic interface of FSlint is too complex. By default, it automatically selects the Duplicate pane and uses your home directory as the search path.
To install fslint, if I run Ubuntu like this, here is the default command:
$ sudo apt-get install fslint
Here are the installation commands for other releases:
Debian:
svn checkout http://fslint.googlecode.com/svn/trunk/ fslint-2.45
cd fslint-2.45
dpkg-buildpackage -I.svn -rfakeroot -tc
sudo dpkg -i ../fslint_2.45-1_all.deb
Fedora:
sudo yum install fslint
OpenSUSE:
[-f /etc/mandrake-release ]&& pkg=rpm
[-f /etc/SuSE-release ]&& pkg=packages
wget http://www.pixelbeat.org/fslint/fslint-2.42.tar.gz
sudo rpmbuild -ta fslint-2.42.tar.gz
sudo rpm -Uvh/usr/src/$pkg/RPMS/noarch/fslint-2.42-1.*.noarch.rpm
For other releases:
wget http://www.pixelbeat.org/fslint/fslint-2.44.tar.gz
tar -xzf fslint-2.44.tar.gz
cd fslint-2.44
(cd po && make)
./fslint-gui
To run the GUI version fslint-gui of fslint in Ubuntu, run the command Alt + F2 or enter:
$ fslint-gui
By default, it automatically selects the Duplicate pane and uses your home directory as the search path. All you need to do is click the Find button. FSlint will automatically Find the list of duplicate files in your home directory.
Click the button to delete any files you want to delete and double-click preview.
After all this is done, we will successfully Delete the duplicate files in your system.
Note that the command line tool is not in the Environment path by default, and you cannot run it like a typical command. In Ubuntu, you can find it under/usr/share/fslint. Therefore, if you want to run a full fslint scan in a separate directory, run the following command in Ubuntu:
cd /usr/share/fslint/fslint
./fslint /path/to/directory
This command does not actually delete any files. It only prints the list of duplicate files-you need to do the following on your own.
$ /usr/share/fslint/fslint/findup --help
find dUPlicate files.
Usage: findup [[[-t [-m|-d]]|[--summary]][-r][-f] paths(s)...]
Ifno path(s) specified then the current directory is assumed.
When-m is specified any found duplicates will be merged (using hardlinks).
When-d is specified any found duplicates will be deleted (leaving just 1).
When-t is specfied, only report what -m or-d would do.
When--summary is specified change output format to include file sizes.
You can also pipe this summary format to /usr/share/fslint/fslint/fstool/dupwaste
to get a total of the wastage due to duplicates.
This article permanently updates the link address: