Skip to content

Commit

Permalink
One-liner to show colored, normalized JSON diffs.
Browse files Browse the repository at this point in the history
  • Loading branch information
jlevy authored May 27, 2019
1 parent 3d8afef commit 84482aa
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -364,6 +364,11 @@ A few examples of piecing together commands:
sort a b b | uniq -u > c # c is set difference a - b
```

- Pretty-print two JSON files, normalizing their syntax, then coloring and paginating the result:
```
diff <(jq --sort-keys . < file1.json) <(jq --sort-keys . < file2.json) | colordiff | less -R
```

- 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`.


Expand Down

0 comments on commit 84482aa

Please sign in to comment.