LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
Search this Thread
Old 11-30-2012, 07:52 AM   #1
depam
Member
 
Registered: Sep 2005
Posts: 829

Rep: Reputation: 30
Comparing two directories and its contents


Is there a way to compare two directories? My objective is to compare two directories and identify files that are on one directory and is missing on the other one. The next thing I want to do is to compare the text files recursively on two directories.
 
Old 11-30-2012, 07:57 AM   #2
linosaurusroot
Member
 
Registered: Oct 2012
Distribution: OpenSuSE,RHEL,Fedora,OpenBSD
Posts: 845
Blog Entries: 2

Rep: Reputation: 212Reputation: 212Reputation: 212
http://linux.about.com/library/cmd/blcmdl1_diff.htm
 
Old 11-30-2012, 07:59 AM   #3
allend
Senior Member
 
Registered: Oct 2003
Location: Melbourne
Distribution: Slackware-current
Posts: 3,485

Rep: Reputation: 856Reputation: 856Reputation: 856Reputation: 856Reputation: 856Reputation: 856Reputation: 856
Perhaps 'diff dir1 dir2'?
Note - diff also takes -r option for recursion
 
Old 11-30-2012, 08:03 AM   #4
Habitual
Senior Member
 
Registered: Jan 2011
Distribution: Undecided
Posts: 3,576
Blog Entries: 1

Rep: Reputation: Disabled
Code:
diff --brief --recursive --report-identical-files /folder1 /folder2
Alternate:
Code:
diff -qr /somedir/ /someotherdir/
http://www.bournetoraiseshell.com/ar...20903112827690
 
Old 01-25-2013, 11:41 PM   #5
depam
Member
 
Registered: Sep 2005
Posts: 829

Original Poster
Rep: Reputation: 30
Thanks this is really helpful
 
  


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 On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Comparing Directories hawkfan50 Programming 1 05-14-2012 08:38 PM
comparing contents of folders newbiesforever Linux - Software 2 02-01-2009 10:44 PM
Comparing two files to get matched contents in another file using shell script pooppp Linux - Networking 3 08-05-2008 01:11 AM
comparing the contents of entire CDs newbiesforever General 3 08-26-2007 08:03 PM
Comparing files contents? hhegab Linux - Newbie 3 07-01-2004 01:45 AM


All times are GMT -5. The time now is 03:46 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration