πΎ Archived View for perso.pw βΊ blog βΊ articles βΊ potw-diffoscope.gmi captured on 2023-12-28 at 16:00:12. Gemini links have been rewritten to link to archived content
β¬ οΈ Previous capture (2023-05-24)
-=-=-=-=-=-=-
Today I will introduce you to Diffoscope, a command line software to compare two directories. I find it very useful when looking for changes between two extracted tarballs, I use it to compare changes between two version of a program to see what changed.
On OpenBSD you can use "pkg_add diffoscope", on other systems you may have a package for it, but it could be installed via pip too.
It is really easy to use, as parameter give the two directories you want to compare, diffoscope will then show the uid, gid, permissions, modification/creation/access time changes between the two directories.
The output on a simple example looks like the following:
--- t/ +++ a/ β --- t/foo βββ +++ a/foo β @@ -1 +1 @@ β -hello β +not hello β βββ stat {} β β @@ -1 +1 @@ β β -1043 492483 -rw-r--r-- 1 solene wheel 1973218 6 "Mar 20 18:31:08 2021" "Mar 20 18:31:14 2021" "Mar 20 18:31:14 2021" 16384 4 0 t/foo β β +1043 77762 -rw-r--r-- 1 solene wheel 314338 10 "Mar 20 18:31:08 2021" "Mar 20 18:31:18 2021" "Mar 20 18:31:18 2021" 16384 4 0 a/foo
Diffoscope has many flags, if you want to only compare the directories content, you have to use "--exclude-directory-metadata yes".
Using the same example as previously with --exclude-directory-metadata yes, it looks like:
--- t/ +++ a/ β --- t/foo βββ +++ a/foo β @@ -1 +1 @@ β -hello β +not hello