Configcompare · Recent & Pro

jq 'del(.metadata.generated, .timestamp)' file1.json

diff -u file1_normalized.json file2_normalized.json Better yet, use a structural diff tool that understands paths: configcompare

# Using jq to show only differing paths diff <(jq -S . file1.json) <(jq -S . file2.json) | grep '^[<>]' | sed 's/^[<>] //' Often you want to ignore timestamps, versions, or auto-generated IDs. jq 'del(

diff <(grep -v '^[[:space:]]*"version"' file1.json) \ <(grep -v '^[[:space:]]*"version"' file2.json) For deeply nested configs, use git diff --no-index with color: diff &lt;(grep -v '^[[:space:]]*"version"' file1

case $EXT in json) diff -u <(jq -S . "$FILE1") <(jq -S . "$FILE2") ;; yaml|yml) diff -u <(yq -P . "$FILE1") <(yq -P . "$FILE2") ;; xml) diff -u <(xmllint --format --c14n "$FILE1") <(xmllint --format --c14n "$FILE2") ;; *) diff -u "$FILE1" "$FILE2" ;; esac

xmllint --format --c14n file1.xml > file1_normalized.xml Now compare the normalized files: