royalaid
royalaid

Reputation: 953

How to add line numbers to JQ output

I was curious if there is a clean way to add line numbers to jq's output while still retaining the coloring of the output. I have tried piping from jq to cat -n but unfortunately this removes the coloring which helps a lot when traversing the JSON tree.

Upvotes: 4

Views: 1737

Answers (1)

peak
peak

Reputation: 116880

Specify the jq -C option explicitly.

Upvotes: 5

Related Questions