#!/bin/bash # Usage: configcompare file1.json file2.json # configcompare file1.yaml file2.yaml FILE1=$1 FILE2=$2 EXT="$FILE1##*."
diff <(grep -v '^[[:space:]]*"version"' file1.json) \ <(grep -v '^[[:space:]]*"version"' file2.json) For deeply nested configs, use git diff --no-index with color: 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. diff -u file1_normalized
diff -u file1_normalized.json file2_normalized.json Better yet, use a structural diff tool that understands paths: not raw line diffs
ConfigCompare is not just about seeing what changed – it's about understanding why a change matters. Use structural tools, not raw line diffs, and you'll debug config issues in seconds instead of hours.
xmllint --format --c14n file1.xml > file1_normalized.xml Now compare the normalized files: