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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
01-01-2005, 01:44 AM
|
#1
|
LQ Newbie
Registered: Mar 2004
Location: Sydney
Posts: 17
Rep:
|
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
|
|
|
01-04-2005, 04:28 AM
|
#2
|
Member
Registered: Dec 2004
Location: Atlanta, GA U.S.
Distribution: I play with them all :-)
Posts: 316
Rep:
|
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.
|
|
|
01-04-2005, 04:37 AM
|
#3
|
Senior Member
Registered: Feb 2003
Distribution: Slackware
Posts: 4,113
Rep: 
|
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. 
|
|
|
01-06-2005, 09:32 PM
|
#4
|
LQ Newbie
Registered: Mar 2004
Location: Sydney
Posts: 17
Original Poster
Rep:
|
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
|
|
|
01-06-2005, 09:35 PM
|
#5
|
Senior Member
Registered: May 2004
Location: In the DC 'burbs
Distribution: Arch, Scientific Linux, Debian, Ubuntu
Posts: 4,290
|
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.
|
|
|
01-07-2005, 12:27 AM
|
#6
|
Senior Member
Registered: Feb 2003
Distribution: Slackware
Posts: 4,113
Rep: 
|
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.

|
|
|
01-07-2005, 12:35 AM
|
#7
|
Member
Registered: Dec 2004
Location: Austin, TX
Distribution: SuSe9.3
Posts: 143
Rep:
|
I second that. Everybody should learn python, it's too easy not to learn.
|
|
|
All times are GMT -5. The time now is 04:19 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|