LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 07-20-2011, 09:09 AM   #1
rileymartin
LQ Newbie
 
Registered: Oct 2009
Posts: 17

Rep: Reputation: 0
Compare directory content that has since been udpated


Hi,

We copied the directories/files from one filesys1 to filesys2 and since that initial copy have further added more directories/files to filesys2 from another source. How can we compare filesys1 to filesys2 to make sure all files/directories were copied successfully to filesys2? I would like a way to check filesys1 against filesys2 and only show/output when something is missing from filesys2 that exists in filesys1 and not report the additional/extra directroies/files that have been copied to filesys2.

Thanks,

Riley
 
Old 07-20-2011, 09:22 AM   #2
Snark1994
Senior Member
 
Registered: Sep 2010
Location: Wales, UK
Distribution: Arch
Posts: 1,632
Blog Entries: 3

Rep: Reputation: 345Reputation: 345Reputation: 345Reputation: 345
Something like:
Code:
diff filesys1/path/to/dir filesys2/path/to/dir -qr | grep "Only in filesys1"
should work fine. If you also wanted to see if there were any files which were different between filesys1 and filesys2 (ie. not copied properly / overwritted) then you can use:
Code:
diff filesys1/path/to/dir filesys2/path/to/dir -qr | egrep -v "Only in filesys2"
Hope this helps,
 
1 members found this post helpful.
Old 07-20-2011, 09:56 AM   #3
rileymartin
LQ Newbie
 
Registered: Oct 2009
Posts: 17

Original Poster
Rep: Reputation: 0
Thank you!

I think that's exactly what I need.
 
Old 07-21-2011, 05:56 AM   #4
Snark1994
Senior Member
 
Registered: Sep 2010
Location: Wales, UK
Distribution: Arch
Posts: 1,632
Blog Entries: 3

Rep: Reputation: 345Reputation: 345Reputation: 345Reputation: 345
Glad to be of assistance. Could you mark the thread as '[SOLVED]' using the thread tools, please?

Thanks,
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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] how to compare $var with content of file Basher52 Linux - Software 21 05-20-2011 07:06 PM
[SOLVED] cannot compare two directories, and print files that have same name and content apanimesh061 Fedora 3 09-17-2010 11:17 AM
how to compare to dir's with some equal content re007 Linux - Newbie 2 04-30-2007 03:49 PM
directory compare tmoorman Linux - Newbie 2 09-26-2003 02:45 PM
Is there any *FILE CONTENT COMPARE* tool in Linux? yuzuohong Linux - General 3 07-14-2002 07:11 AM


All times are GMT -5. The time now is 02:20 PM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration