LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Compare directory content that has since been udpated (https://www.linuxquestions.org/questions/linux-newbie-8/compare-directory-content-that-has-since-been-udpated-892721/)

rileymartin 07-20-2011 08:09 AM

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

Snark1994 07-20-2011 08:22 AM

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,

rileymartin 07-20-2011 08:56 AM

Thank you!

I think that's exactly what I need.

Snark1994 07-21-2011 04:56 AM

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

Thanks,


All times are GMT -5. The time now is 05:21 PM.