LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 01-01-2005, 01:44 AM   #1
rvoigt
LQ Newbie
 
Registered: Mar 2004
Location: Sydney
Posts: 17

Rep: Reputation: 0
How to compare two folders contents?


Hi there,

What is a good syncronisation tool on linux?
Is there a command that would allow me to compare two folder content?
I need it for my backup.


Thank you
Neon
 
Old 01-04-2005, 04:28 AM   #2
Harlin
Member
 
Registered: Dec 2004
Location: Atlanta, GA U.S.
Distribution: I play with them all :-)
Posts: 316

Rep: Reputation: 38
Ahh, the answer you seek are Python scripts, my friend!!!

What about the directory contents do you need to compare? file contents, size, creation dates? No doubt there are ways to do it. If you give an accurate description of what it is you want to do, I'm sure I or someone else can help you do it or point you in the right direction. For the time being with the criteria you gave, I can point you to take up your cross and go search for the Holy Grail by learning Python.
 
Old 01-04-2005, 04:37 AM   #3
slakmagik
Senior Member
 
Registered: Feb 2003
Distribution: Slackware
Posts: 4,113

Rep: Reputation: Disabled
And there's also diff (it's not just for files) and rsync (it's not just for remote sync) and so on.

Not that I wouldn't mind seeing some cool python.
 
Old 01-06-2005, 09:32 PM   #4
rvoigt
LQ Newbie
 
Registered: Mar 2004
Location: Sydney
Posts: 17

Original Poster
Rep: Reputation: 0
I reply to Digiot, I need to compare dates and whether two folders have the same contents. I save all my work on my PC HD and I backup everything on a removable drive which contain the same folders and I need the backup drive to be up to date with the main HD after each backup.
Unfortunately I don't have any knowledge about Python. I only got basic knowledge in C, C++ and shell scripting.

In regard to Harlin, I actually just find out that diff could also work with folfers. I not sure if diff could do the job. If diff can work on modified date of file I am thinking of writing a shell script that might do the job.

Appreciate the help.
Neon
 
Old 01-06-2005, 09:35 PM   #5
btmiller
Senior Member
 
Registered: May 2004
Location: In the DC 'burbs
Distribution: Arch, Scientific Linux, Debian, Ubuntu
Posts: 4,290

Rep: Reputation: 378Reputation: 378Reputation: 378Reputation: 378
Sounds like rsync is more like what you're looking for then. It compares two directories and synchronizes them. It can even work over SSH across the network. You can read the man page for more info.
 
Old 01-07-2005, 12:27 AM   #6
slakmagik
Senior Member
 
Registered: Feb 2003
Distribution: Slackware
Posts: 4,113

Rep: Reputation: Disabled
Quote:
Taken from http://www.hillside.co.uk/articles/typing.html
Dammit! I've been stuck at http://www.hillside.co.uk/articles/sunexpert.html for *hours* thanks to you.

 
Old 01-07-2005, 12:35 AM   #7
JoeUser11
Member
 
Registered: Dec 2004
Location: Austin, TX
Distribution: SuSe9.3
Posts: 143

Rep: Reputation: 15
I second that. Everybody should learn python, it's too easy not to learn.
 
  


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
compare folders GUI linmix Linux - Newbie 4 09-12-2011 05:21 PM
compare two folders bluenectar Linux - Newbie 10 08-04-2005 11:23 PM
Bash script to compare dir contents Boffy Programming 2 08-02-2005 06:08 AM
removing folders & its contents wisdom Linux - General 11 12-24-2004 02:10 AM
to compare the contents of 2 files MaleWithBrains Linux - Newbie 3 01-27-2004 06:39 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

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