LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 06-07-2012, 11:26 AM   #1
Skaperen
Senior Member
 
Registered: May 2009
Location: center of singularity
Distribution: Xubuntu, Ubuntu, Slackware, Amazon Linux, OpenBSD, LFS (on Sparc_32 and i386)
Posts: 2,684
Blog Entries: 31

Rep: Reputation: 176Reputation: 176
Reduction of common files in trees


I don't think such a program exists. But I'll check here just in case. I suspect I need to create this program.

I have 2 file trees. There are a LOT of common files between these trees, and a lot of different files. Differences may exist only in metadata (e.g. time created, owner, permissions) or only in content. Usually if one is different the other is different, but since exceptions can exist, this cannot be depended on.

What I want to do is scan both of these trees and create as output 2 new trees, without disturbing the original trees. Output tree 1 shall contain all files that are unique to input tree 1. Output tree 2 shall contain all files that are unique to input tree 2. Output tree 3 shall contain all files that are shared in common between both input tree 1 and input tree 2.

If output tree 1 and output tree 3 are merged, the result will be identical to input tree 1. If output tree 2 and output tree 3 are merged, the result will be identical to input tree 2.

Any ideas?
 
Old 06-07-2012, 10:44 PM   #2
evo2
LQ Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and CentOS
Posts: 6,724

Rep: Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705
Hi,

I don't know of a turnkey solution, but you can use fdupes to find duplicate files.
Combine that with a little bit of scripting and your should be able to achieve what you want without too much pain.

Regarding "similar files": recently there was an interesting blog post by Axel Beckert on that very topic.

http://noone.org/blog/English/Comput...ty-tester.html

HTH,

Evo2.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Same files on distinct directory trees 0p3r4t4 Linux - General 1 11-25-2011 05:01 AM
pam common- files arizonagroovejet Linux - General 2 07-29-2011 08:01 AM
How to change a common name in files? Drigo Linux - Newbie 3 10-29-2009 09:07 PM
Multiple Distro's, common files osbert Linux - General 1 07-27-2009 01:19 PM
comparing files..ouput which r not common fs11 Programming 1 06-25-2007 05:09 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 06:54 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration