Linux Format

Answers

Comparing directories

Q I have two folders that are backups from different months of the same Linux: LinuxA and LinuxB. I want to know what was modified in LinuxB compared to LinuxA. I have heard about the diff command, but reading the diff manual doesn’t seem right: “GNU diff – compare files line by line”

The comparison I believe I need is to compare the files by date modified and if different, that file has certainly changed. Do you have any idea how I can do this?

Nick

A Modification dates do not provide a reliable guide as to whether a file has changed. Consider a program that loads it settings when it starts and saves them on exit. The configuration file’s timestamp will change but the contents will be the same if you haven’t made any changes. Your suggestion of diff considers the contents, but as you say it is for text files, and also it outputs a list of the differences, whereas you only want to know what has changed.

One program that can be used to find such files, checking their contents, is . This program is designed specifically to do what you need – find duplicate files. It first checks file size and then, for files of the same size, it compares checksums of the files’ contents. It doesn’t take

You’re reading a preview, subscribe to read more.

More from Linux Format

Linux Format1 min read
Ultimate Desktop Upgrade!
LXF316 will be on sale Tuesday 28th May 2024 Word processors that can help craft that novel you’ve always been talking about and organise large projects. Revive the old roleplaying system for a digital age as we recreate our own play-by-mail gaming
Linux Format4 min read
Linux
The #1 open source mag Future Publishing Limited, Quay House, The Ambury, Bath, BA1 1UA Email contact@linuxformat.com EDITORIAL Editor-in-chief Neil Mohr Art editor Fraser McDermott Production editor Katharine Davies Group editor-in-chief Graham Bar
Linux Format2 min read
Platform Support And Editions
Kali has a huge variety of install options, and these include images for ARM-based computers and pre-made virtual K machine images for most of the popular virtualisers. It’s even possible to install a version of Kali on to an Android-powered device.

Related Books & Audiobooks