Just throwing another solution in the mix…
Try jq, a lightweight and flexible command-line JSON processor:
jq length /tmp/test.json
Prints the length of the array of objects.
Just throwing another solution in the mix…
Try jq, a lightweight and flexible command-line JSON processor:
jq length /tmp/test.json
Prints the length of the array of objects.