LinuxQuestions.org
Visit Jeremy's Blog.
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 12-29-2009, 07:44 AM   #1
sr71919
LQ Newbie
 
Registered: Dec 2009
Location: Chennai, Tamil nadu, INDIA
Distribution: Fedora
Posts: 14

Rep: Reputation: 1
How to find the difference between two directory structures


Hi all,
How to find the difference between two directories, need a summary of all the added, updated, deleted files/directories.
Like diff is for files, what is for directories?
 
Old 12-29-2009, 07:51 AM   #2
imitheos
Member
 
Registered: May 2005
Location: Greece
Posts: 441

Rep: Reputation: 141Reputation: 141
Quote:
Originally Posted by sr71919 View Post
Hi all,
How to find the difference between two directories, need a summary of all the added, updated, deleted files/directories.
Like diff is for files, what is for directories?
Since you mentioned diff, if you run "diff -r dir1 dir2" it will produce
a diff output of all the changes of same-named files in both dirs. It will
also tell you which files exist only in the one (added) or the other dir (deleted).

Depending on what you want the output may not be pretty/parseable but
you can try it.

Last edited by imitheos; 12-29-2009 at 07:52 AM.
 
Old 12-29-2009, 07:54 AM   #3
sr71919
LQ Newbie
 
Registered: Dec 2009
Location: Chennai, Tamil nadu, INDIA
Distribution: Fedora
Posts: 14

Original Poster
Rep: Reputation: 1
Manually it can be done using find/grep/diff etc, but i need a tool for the purpose of saving time.

Pl Suggest any other quicker way.
 
Old 12-29-2009, 08:36 AM   #4
AlucardZero
Senior Member
 
Registered: May 2006
Location: USA
Distribution: Debian
Posts: 4,824

Rep: Reputation: 615Reputation: 615Reputation: 615Reputation: 615Reputation: 615Reputation: 615
Code:
ls -AlR /dir1 > /tmp/dir1
ls -AlR /dir2 > /tmp/dir2
diff /tmp/dir1 /tmp/dir2
 
  


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
non standard [custom] directory structures ayteebee Linux - Desktop 5 08-17-2006 11:59 AM
help: regarding comparing two directory tree structures raj_thota Linux - Software 2 11-02-2005 12:19 PM
Help: regarding comparing two directory tree structures raj_thota Solaris / OpenSolaris 1 11-02-2005 07:16 AM
How can i find the difference for directory alice95089 Linux - Software 4 02-07-2005 08:49 AM
Difference b/w structures and classes kamransoomro84 Programming 8 04-22-2004 02:45 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 03:07 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
Open Source Consulting | Domain Registration