The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
Google UNIX.COM


UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Backup Directories and SubDirectories with log using DOS osramos Windows & DOS: Issues & Discussions 1 11-14-2007 02:10 PM
Display only subdirectories from given directories HAA Shell Programming and Scripting 8 04-25-2007 02:36 AM
perform diff between 2 directories umen UNIX for Dummies Questions & Answers 5 08-25-2006 08:55 AM
Permissions for Directories and Subdirectories clancymf UNIX for Dummies Questions & Answers 1 08-07-2006 03:40 PM
How to Remove Ctrl M characters in files from directories and its subdirectories skdp Shell Programming and Scripting 7 07-29-2006 08:53 PM

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 07-11-2007
Registered User
 

Join Date: Jul 2007
Posts: 5
Compare/Diff between directories and subdirectories?

Hi,

Does anybody know the cmd to compare two areas and print out the different files w/ path?

I tried cmp and diff and dircmp but with no luck.

Should I grep and print?

For example:

/aa/images/jan
..../images/feb

/bb/images/jan
..../images/feb

i want to print the compare, find, and print the difference of /aa and /bb.

Thanks again.
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 07-11-2007
Registered User
 

Join Date: Jan 2007
Posts: 2,965
Quote:
Originally Posted by andylee80 View Post
Does anybody know the cmd to compare two areas and print out the different files w/ path?
What counts as an 'area'?

Have you looked at 'find'?
Reply With Quote
  #3 (permalink)  
Old 07-11-2007
Shell_Life's Avatar
Unix/Informix/4GL/SQL
 

Join Date: Mar 2007
Location: Bahia, Brazil
Posts: 695
I got confused about this one too, Porter.
Andylee80, please give us more descriptive examples.
Reply With Quote
  #4 (permalink)  
Old 07-11-2007
Registered User
 

Join Date: Jul 2007
Posts: 5
Sorry for being vague.

Nevermind about the 'area'.

On my unix box, I have the following directories:

/home/intranet/images

and

/home/internet/images

I want to compare the two and print out the difference w/ path. Something like this:

#some cmd
+ /images/jan07/home.gif
+ /images/jan07/button.gif

These two files exist in /intranet/images but not in /internet/images.

Sorry if it's not clear.
Reply With Quote
  #5 (permalink)  
Old 07-11-2007
Shell_Life's Avatar
Unix/Informix/4GL/SQL
 

Join Date: Mar 2007
Location: Bahia, Brazil
Posts: 695
See if this works for you:
Code:
ls -1 /home/intranet/images | sort > /tmp/Intra
ls -1 /home/internet/images | sort > /tmp/Inter
diff Intra Inter
Reply With Quote
  #6 (permalink)  
Old 07-12-2007
Registered User
 

Join Date: Jul 2007
Posts: 93
try the dircmp command:

format: dircmp -s dir1 dir2 | uniq
Reply With Quote
Google UNIX.COM
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 01:14 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008 The CEP Blog All Rights Reserved -Ad Management by RedTyger Visit The Global Fact Book

Content Relevant URLs by vBSEO 3.2.0