Skip to content

Commit 84482aa

Browse files
authored
One-liner to show colored, normalized JSON diffs.
1 parent 3d8afef commit 84482aa

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -364,6 +364,11 @@ A few examples of piecing together commands:
364364
sort a b b | uniq -u > c # c is set difference a - b
365365
```
366366

367+
- Pretty-print two JSON files, normalizing their syntax, then coloring and paginating the result:
368+
```
369+
diff <(jq --sort-keys . < file1.json) <(jq --sort-keys . < file2.json) | colordiff | less -R
370+
```
371+
367372
- Use `grep . *` to quickly examine the contents of all files in a directory (so each line is paired with the filename), or `head -100 *` (so each file has a heading). This can be useful for directories filled with config settings like those in `/sys`, `/proc`, `/etc`.
368373

369374

0 commit comments

Comments
 (0)