User Tools

Site Tools


info:script:compare_directories
Please note, that this is an old archived version of this site. Check out the new version at andunix.net!

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

info:script:compare_directories [2018-09-19 12:34] (current)
andunix created
Line 1: Line 1:
 +====== Compare directories ======
  
 +For each of the directories, generate a digest file:
 +
 +<code bash>
 +find DIR -type f -exec shasum {} + | LC_ALL=C sort -d -k 2 > shasums.txt
 +</code>
 +
 +It's important to use ''LC_ALL=C'' and the option ''-d'' of ''sort'', to get compareable results on different machines.
 +
 +After that, you can diff the two shasums.txt:
 +
 +<code bash>
 +diff shasums1.txt shasums2.txt
 +</code>
 +
 +Or you use Meld as graphical diff tool:
 +
 +<code bash>
 +meld shasums1.txt shasums2.txt
 +</code>
 +
 +{{tags>cli sysadmin}}
info/script/compare_directories.txt · Last modified: 2018-09-19 12:34 by andunix