![linux 查找重复文件](https://img-blog.csdnimg.cn/img_convert/d6ae61adde6e78d6e72ea2523ddb3c14.png)
linux 查找重复文件
Hi, long time age when I was new comer to the Linux world I was using duplicate file finder named fdupes. But after a time I change my OS to windows and again to Linux. But I stopped using fdupes. Today When I was looking to the file compression of btrfs I found fdupes again and run in my test system. It it very useful tool for untidy persons on the computer. By the way I am not untidy in my computer 🙂 . Lets look to fdupes. Fdupes looks files with their size and MD5 and then byte by byte comparison.
嗨,很长一段时间,当我刚进入Linux世界时,我使用的是名为fdupes的重复文件查找器。 但是一段时间后,我将操作系统更改为Windows,然后再次更改为Linux。 但是我停止使用fdupes。 今天,当我寻找btrfs的文件压缩时,我再次发现fdupes并在我的测试系统中运行。 对于计算机上不整洁的人来说,它是非常有用的工具。 顺便说一下,我在电脑上并不整洁🙂。 让我们来看看fdupes。 Fdupes查找文件的大小和MD5,然后逐字节比较。
安装fdupes (Install fdupes)
Ubuntu,Debian,Kali,Mint (Ubuntu, Debian, Kali, Mint)
We will install fdupes
with the following command for Ubuntu, Debian, Kali, Mint.
我们将使用以下命令为Ubuntu,Debian,Kali,Mint安装fdupes
。
$ sudo apt install fdupes
![Install fdupes](https://img-blog.csdnimg.cn/img_convert/c52c284e65440b42f0cd7d8797e23fe5.png)
Fedora,CentOS,RedHat (Fedora, CentOS, RedHat)
For yum
based installation for fdupes
with the following command.
对于基于yum
的fdupes
安装, fdupes
使用以下命令。
$ sudo yum install fdupes
只是看起来重复的文件 (Simply Look Duplicate Files)
Look current working directory with recursive style where all files folders and subfolders are looked.
使用递归样式查找当前工作目录,在该目录中将查找所有文件文件夹和子文件夹。
$ fdupes -r .
![Simply Look Duplicate Files](https://img-blog.csdnimg.cn/img_convert/6cc7de31a2b2c685d594baa0c153c532.png)
We can see an duplicate example below. Files pass
, Vide
and others all the same.
我们可以在下面看到一个重复的示例。 文件pass
, Vide
和其他文件都相同。
![Simply Look Duplicate Files](https://img-blog.csdnimg.cn/img_convert/7ba788da53b628ddee7ad5efb5f2ccfc.png)
遵循符号和硬链接(Following Symbolic and Hard Links)
By default symbolic and hardlinks do not followed by fdupes. We can enable to follow sym and hard link with the -s
and -H
options. This can be useful if there are some link to other paths.
默认情况下,符号和硬链接后不包含fdupes。 我们可以使用-s
和-H
选项启用符号和硬链接。 如果存在指向其他路径的链接,这将很有用。
$ fdupes -r -s -H .
显示重复文件的大小信息 (Show Size Information of Duplicate Files)
Before deleting files we may want to list the size of duplicate files. We can use -S
to list sizes of the duplicate files.
在删除文件之前,我们可能要列出重复文件的大小。 我们可以使用-S
列出重复文件的大小。
$ fdupes -r -S .
![Show Size Information of Duplicate Files](https://img-blog.csdnimg.cn/img_convert/b4d57dd2d1fe9fab1177b4e40584aa20.png)
未经确认即删除(Delete Without Confirmation)
And the most useful and dangerous command where duplicate ones are deleted. Use this command in your own risk.
而最有用和最危险的命令就是删除重复的命令。 使用此命令需要您自担风险。
$ fdupes -r -d .
如何在Linux中查找和删除重复文件? 信息图 (How To Find and Remove Duplicate Files In Linux? Infographic)
![How To Find and Remove Duplicate Files In Linux? Infographic](https://img-blog.csdnimg.cn/img_convert/8f7383fb7e87ddd20f21107d5f987b4c.png)
翻译自: https://www.poftut.com/find-remove-duplicate-files-linux/
linux 查找重复文件