LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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, 02: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, 05:28 AM   #2
Harlin
Member
 
Registered: Dec 2004
Location: Atlanta, GA U.S.
Distribution: I play with them all :-)
Posts: 316

Rep: Reputation: 30
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, 05: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, 10: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, 10:35 PM   #5
btmiller
Senior Member
 
Registered: May 2004
Location: In the DC 'burbs
Distribution: Arch, Scientific Linux, Debian, Ubuntu
Posts: 4,275

Rep: Reputation: 370Reputation: 370Reputation: 370Reputation: 370
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, 01: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, 01: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


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
compare folders GUI linmix Linux - Newbie 4 09-12-2011 06:21 PM
compare two folders bluenectar Linux - Newbie 10 08-05-2005 12:23 AM
Bash script to compare dir contents Boffy Programming 2 08-02-2005 07:08 AM
removing folders & its contents wisdom Linux - General 11 12-24-2004 03:10 AM
to compare the contents of 2 files MaleWithBrains Linux - Newbie 3 01-27-2004 07:39 PM


All times are GMT -5. The time now is 08:26 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration