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 Format3 min read
Kernel Watch
Linus Torvalds announced the fourth RC (Release Candidate) for what will become Linux 6.9 in another few weeks. In his announcement, he noted that there was “Nothing particularly unusual going on this week – some new hardware mitigations may stand o
Linux Format2 min read
Specialist Tool Organisation
K ali works differently from the others as it has the security tools in the root of the app launcher. If you know what you’re looking for, the whole thing is searchable from the launcher. The ‘normal’ apps are located in the Usual Applications folder
Linux Format14 min read
Ubuntu at 20
Without Ubuntu, the current Linux landscape would be unrecognisable. Back in October 2004, the first 4.10 (2004.10) release of Ubuntu, with its intriguing Warty Warthog code name, leapt from obscurity to being one of the most downloaded Linux distrib

Related Books & Audiobooks