加入收藏 | 设为首页 | 会员中心 | 我要投稿 成都站长网 (https://www.028zz.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 建站 > 正文

如何在Linux上识别同样内容的文件

发布时间:2019-06-11 19:59:04 所属栏目:建站 来源:Sandra Henry-stocker
导读:副标题#e# 有时文件副本相当于对硬盘空间的巨大浪费,并会在你想要更新文件时造成困扰。以下是用来识别这些文件的六个命令。 在最近的帖子中,我们看了如何识别并定位硬链接的文件(即,指向同一硬盘内容并共享 inode)。在本文中,我们将查看能找到具有相

你可以在 dryrun 模式中运行这个命令 (换句话说,仅仅汇报可能会另外被做出的改动)。

  1. $ rdfind -dryrun true ~
  2. (DRYRUN MODE) Now scanning "/home/shark", found 12 files.
  3. (DRYRUN MODE) Now have 12 files in total.
  4. (DRYRUN MODE) Removed 1 files due to nonunique device and inode.
  5. (DRYRUN MODE) Total size is 699352 bytes or 683 KiB
  6. Removed 9 files due to unique sizes from list.2 files left.
  7. (DRYRUN MODE) Now eliminating candidates based on first bytes:removed 0 files from list.2 files left.
  8. (DRYRUN MODE) Now eliminating candidates based on last bytes:removed 0 files from list.2 files left.
  9. (DRYRUN MODE) Now eliminating candidates based on sha1 checksum:removed 0 files from list.2 files left.
  10. (DRYRUN MODE) It seems like you have 2 files that are not unique
  11. (DRYRUN MODE) Totally, 223 KiB can be reduced.
  12. (DRYRUN MODE) Now making results file results.txt

rdfind 命令同样提供了类似忽略空文档(-ignoreempty)和跟踪符号链接(-followsymlinks)的功能。查看 man 页面获取解释。

  1. -ignoreempty ignore empty files
  2. -minsize ignore files smaller than speficied size
  3. -followsymlinks follow symbolic links
  4. -removeidentinode remove files referring to identical inode
  5. -checksum identify checksum type to be used
  6. -deterministic determiness how to sort files
  7. -makesymlinks turn duplicate files into symbolic links
  8. -makehardlinks replace duplicate files with hard links
  9. -makeresultsfile create a results file in the current directory
  10. -outputname provide name for results file
  11. -deleteduplicates delete/unlink duplicate files
  12. -sleep set sleep time between reading files (milliseconds)
  13. -n, -dryrun display what would have been done, but don't do it

(编辑:成都站长网)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

热点阅读