{"id":12320,"date":"2021-11-24T04:59:56","date_gmt":"2021-11-24T04:59:56","guid":{"rendered":"https:\/\/linuxways.net\/?p=12320"},"modified":"2021-11-24T04:59:56","modified_gmt":"2021-11-24T04:59:56","slug":"best-3-tools-to-find-and-delete-duplicate-files-in-linux","status":"publish","type":"post","link":"https:\/\/linuxways.net\/de\/centos\/best-3-tools-to-find-and-delete-duplicate-files-in-linux\/","title":{"rendered":"Best 3 Tools to Find and Delete Duplicate Files in Linux"},"content":{"rendered":"<p>Managing files might be a complicated task if there are a large number of duplicate files present in the system. Large volume of duplicate files occupies the storage space and may create disk full issues. Easiest way to deal with duplicate files is to locate them and delete manually but using a tool to find and delete duplicate files can significantly make the process easier. In this article, we will learn some useful utility tools to find and delete duplicate files from the Linux system.<\/p>\n<h2>Fslint<\/h2>\n<p>In Linux\/Unix based systems, there is a very useful tool called \u201cfslint\u201d which helps to search and remove duplicate files, temp files, empty folders completely and free up the disk space. Fslint comes with both GUI and CLI mode which makes it easier to use. Installation of this utility tool is simple and easy. Just run the following command and start using the tool<\/p>\n<p><strong>Ubuntu\/Debian<\/strong><\/p>\n<pre>$ sudo apt-get install fslint<\/pre>\n<p>In the Ubuntu 20.04 LTS, fslint is not available in the default repository. Use the following command to install the tool.<\/p>\n<pre>$ mkdir -p ~\/Downloads\/fslint<\/pre>\n<pre>$ cd ~\/Downloads\/fslint<\/pre>\n<pre>$ wget http:\/\/old-releases.ubuntu.com\/ubuntu\/pool\/universe\/p\/pygtk\/python-gtk2_2.24.0-6_amd64.deb<\/pre>\n<pre>$ wget http:\/\/old-releases.ubuntu.com\/ubuntu\/pool\/universe\/p\/pygtk\/python-glade2_2.24.0-6_amd64.deb<\/pre>\n<pre>$ wget http:\/\/old-releases.ubuntu.com\/ubuntu\/pool\/universe\/f\/fslint\/fslint_2.46-1_all.deb<\/pre>\n<pre>$ sudo apt-get install .\/*.deb<\/pre>\n<p><strong>RHEL\/CentOS<\/strong><\/p>\n<pre>$ sudo yum install epel-release<\/pre>\n<pre>$ sudo yum install fslint<\/pre>\n<p>Once the installation is completed, look for fslink in the application. Provide the directory to scan the files and tick <strong>recurse<\/strong> option to scan files in the subdirectories recursively . Once the scan is completed, click delete to remote the duplicate files.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"803\" height=\"501\" class=\"wp-image-12321\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/11\/word-image-449.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/11\/word-image-449.png 803w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/11\/word-image-449-300x187.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/11\/word-image-449-768x479.png 768w\" sizes=\"auto, (max-width: 803px) 100vw, 803px\" \/><\/p>\n<h2>Rdfind<\/h2>\n<p>Rdfind is an open source and free utility tool to find duplicate files. It compares the files based on the content and differentiates the original and duplicate files using a classification algorithm. Once the duplicate file is found, it provides a report as a result.<\/p>\n<p>Run the following command to install the tool<\/p>\n<p><strong>Ubuntu\/Debian<\/strong><\/p>\n<pre>$ sudo apt-get install rdfind<\/pre>\n<p><strong>RHEL\/CentOS<\/strong><\/p>\n<pre>$ sudo yum install epel-release<\/pre>\n<pre>$ sudo yum install rdfind<\/pre>\n<p>Once the tool is installed, run the<strong> rdfind <\/strong>command along with the directory path where we want to find duplicate files. In this example, I have used <strong>\/home\/aayush\/Download<\/strong> is being used. You can have your own assumption.<\/p>\n<p>Syntax<\/p>\n<pre>$ rdfind &lt;Path&gt;<\/pre>\n<p>Example<\/p>\n<pre>$ rdfind \/home\/aayush\/Downloads<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"885\" height=\"198\" class=\"wp-image-12322\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/11\/word-image-450.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/11\/word-image-450.png 885w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/11\/word-image-450-300x67.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/11\/word-image-450-768x172.png 768w\" sizes=\"auto, (max-width: 885px) 100vw, 885px\" \/><\/p>\n<p>A report file called results.txt is generated in the current work directory. Find the file for more details related to duplicate files.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"841\" height=\"92\" class=\"wp-image-12323\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/11\/word-image-451.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/11\/word-image-451.png 841w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/11\/word-image-451-300x33.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/11\/word-image-451-768x84.png 768w\" sizes=\"auto, (max-width: 841px) 100vw, 841px\" \/><\/p>\n<h3>Fdupes<\/h3>\n<p>Fdupes is another useful utility tool available in Linux systems. It is free and open source and written in C programming language. This utility tool identifies duplicate files by comparing file sizes, partial MD5 signature, full MD5 signature and performing byte by byte comparison for the verification.<\/p>\n<p>Run the following command to install the tool<\/p>\n<p><strong>Ubuntu\/Debian<\/strong><\/p>\n<pre>$ sudo apt-get install fdupes<\/pre>\n<p><strong>RHEL\/Centos<\/strong><\/p>\n<pre>$ yum install epel-release<\/pre>\n<pre>$ yum install fdupes<\/pre>\n<p>Once the tool is installed, run the <strong>fdupes <\/strong>command along with the path where we want to find the duplicate files.<\/p>\n<p>Syntax<\/p>\n<pre>$ fdupes &lt;path&gt;<\/pre>\n<p>Example<\/p>\n<pre>$ fdupes \/home\/aayush\/Downloads\/Kubernetes<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"743\" height=\"97\" class=\"wp-image-12324\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/11\/word-image-452.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/11\/word-image-452.png 743w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/11\/word-image-452-300x39.png 300w\" sizes=\"auto, (max-width: 743px) 100vw, 743px\" \/><\/p>\n<p>To search the duplicate files in the subdirectories, run the <strong>fdupes<\/strong> command with the option <strong>-r<\/strong> along with the path.<\/p>\n<p>Syntax<\/p>\n<pre>$ fdupes &lt;Path&gt; -r<\/pre>\n<p>Example<\/p>\n<pre>$ fdupes \/home\/aayush\/Downloads -r<\/pre>\n<p>Output:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"697\" height=\"136\" class=\"wp-image-12325\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/11\/word-image-453.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/11\/word-image-453.png 697w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/11\/word-image-453-300x59.png 300w\" sizes=\"auto, (max-width: 697px) 100vw, 697px\" \/><\/p>\n<p>To remove all the duplicates, run fdupes command with the option -d along with the path.<\/p>\n<p>Syntax<\/p>\n<pre>$ fdupes -d &lt;Path&gt;<\/pre>\n<p>Example<\/p>\n<pre>$ fdupes -d \/home\/aayush\/Downloads\/Kubernetes<\/pre>\n<p>Output<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"821\" height=\"128\" class=\"wp-image-12326\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/11\/word-image-454.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/11\/word-image-454.png 821w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/11\/word-image-454-300x47.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/11\/word-image-454-768x120.png 768w\" sizes=\"auto, (max-width: 821px) 100vw, 821px\" \/><\/p>\n<p>To delete all the duplicates in the subdirectories, run the <strong>fdupes<\/strong> command recursively(<strong>-r<\/strong>) with the option <strong>-d<\/strong> as.<\/p>\n<p>Syntax<\/p>\n<pre>$ fdupes -d &lt;path&gt; -r<\/pre>\n<p>Example<\/p>\n<pre>$ fdupes -d \/home\/aayush\/Downloads -r<\/pre>\n<p>To get more help on fdupes command, run the following command.<\/p>\n<pre>$ fdupes --help<\/pre>\n<pre>$ man fdupes<\/pre>\n<h2>Conclusion<\/h2>\n<p>Sometimes, having duplicate files in the system might create a really big issue. In this article, I have covered different tools to find and delete duplicate files in the linux system. Thank you for reading.<\/p>","protected":false},"excerpt":{"rendered":"<p>Managing files might be a complicated task if there are a large number of duplicate files present in the system. Large volume of duplicate files occupies the storage&hellip;<\/p>","protected":false},"author":1,"featured_media":12398,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1,4,5,83,165,2],"tags":[135,35],"class_list":["post-12320","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-centos","category-debian","category-mint","category-opensuse","category-red-hat","category-ubuntu","tag-files-2","tag-linux"],"_links":{"self":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts\/12320","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/comments?post=12320"}],"version-history":[{"count":1,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts\/12320\/revisions"}],"predecessor-version":[{"id":12397,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts\/12320\/revisions\/12397"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/media\/12398"}],"wp:attachment":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/media?parent=12320"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/categories?post=12320"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/tags?post=12320"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}