given two directory trees how to find which files are the same?
来源:互联网 发布:医学大数据分析工资 编辑:程序博客网 时间:2024/05/17 02:43
I am writing a bash script, and I would like to know which files are the same in two directory trees.
It would be the opposite of using diff.
Well i found the answer myself. I had tried it before, but I thought it did not work.
diff -srq dir1/ dir2/ | grep identical
You can use a utility like fdupes or rdfind to list duplicate files. For example:
fdupes --recurse dir1 dir2
You might also want to use the
--sameline
flag to list all duplicates on the same line, rather than in text blocks, depending on how you want to parse the results.
阅读全文
0 0
- given two directory trees how to find which files are the same?
- Compare two files are exactly the same
- Given two binary trees, write a function to check if they are equal or not.
- How to find the file which contain a specified string
- 73 Which two are the prerequisites to enable Flashback Data Archive? (Choose two.) A. Database must
- Why the same files are copied to /Approot and /Siteroot in Windows Azure WebRole?
- OpenVMS - How to Find which Processes Are Using a Specific Pagefile
- Openvms-C-Sourcecode- How to Find which Processes are using a specific pagefile or swapfile
- How to create a custom directory for app files inside the ~/Library/Application Support directory.
- How to clear the views which are held in the ListView's RecycleBin?
- How can I find which tables reference a given table
- How to compare the differences of the same file in the two nodes
- how to find the corresponding libraries are linked to when some APIs are used(2.0)
- how to find the corresponding libraries are linked to when some APIs are used(3.0)
- 每日刷题(2015/6/23)You are given the source to an application which crashes when it is run.
- How to Have Two Versions of the Same App on Your Device
- How to make two <div>…</div> in the same row?
- How to find a directory on linux?
- Android性能优化典范
- 时间控件二--timepicker
- 程序员是不是最后非得转管理才可以?
- android Api文档笔记(一)进程
- 【人生百味】那些透支健康而获得的成就真的值得吗?
- given two directory trees how to find which files are the same?
- c++调用ffmpeg sdk中出现的一些常见问题解决方法
- boot空间不足,删除ubuntu内核
- wosa标准专有设备访问与锁定
- 单张图片延迟加载
- 能上QQ但是打不开网页
- 调用函数时前面为什么要加(void)
- 工作日记2017.08.17
- CS模型之服务器进程终止