LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 07-17-2008, 09:40 PM   #1
ust
Senior Member
 
Registered: Mar 2003
Location: fasdf
Distribution: Debian / Suse /RHEL
Posts: 1,130

Rep: Reputation: 31
use "diff" to compare any file missing


I have two directory , I would like to compare the file difference , if found any file is not match , then send me alert , like the below example , the /ora1 have the file test3 , but /ora2 do not have , /ora2 have file test4 but /ora1 do not have , then send me alter mail for the difference , can advise what can i do ?

#ls /ora1
test1
test2
test3

#ls /ora2
test1
test2
test4


Furthermore , under /ora1 have a directory temp ( but /ora2 do not have this directory ) , so how to only compare the file but not compare directory ?


Please advise what can i do ? thx
 
Old 07-17-2008, 10:18 PM   #2
trickykid
LQ Guru
 
Registered: Jan 2001
Posts: 24,149

Rep: Reputation: 269Reputation: 269Reputation: 269
So, are you trying to tell us you want the members to write you a script?
 
Old 07-17-2008, 10:25 PM   #3
ust
Senior Member
 
Registered: Mar 2003
Location: fasdf
Distribution: Debian / Suse /RHEL
Posts: 1,130

Original Poster
Rep: Reputation: 31
Quote:
Originally Posted by trickykid View Post
So, are you trying to tell us you want the members to write you a script?
thx reply ,

no , I have it , I would like to ask how to compare the file only ?

thx
 
Old 07-17-2008, 10:35 PM   #4
trickykid
LQ Guru
 
Registered: Jan 2001
Posts: 24,149

Rep: Reputation: 269Reputation: 269Reputation: 269
The version of diff I have installed doesn't seem to have a ignore directory. Although when I tested, if it found differences it prints out the name. You could always grep it out of the final output since you know the name is temp/

diff <dir1> <dir2> | grep -v temp
 
  


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
Feeding the output of "diff" or "cat" command to dpkg --purge kushalkoolwal Debian 9 06-19-2008 07:27 AM
"Xlib: extension "XFree86-DRI" missing on display ":0.0"." zaps Linux - Games 9 05-14-2007 03:07 PM
Video Card Nvidia Driver Xlib: extension "GLX" missing on display ":0.0". HELP! badgerbox76 Linux - Newbie 35 03-08-2007 02:27 AM
suse ati driver "Xlib: extension "XiG-SUNDRY-NONSTANDARD" missing" madcow007 Linux - Hardware 0 03-06-2004 02:53 PM

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

All times are GMT -5. The time now is 04:34 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