get json array length jq code example Example: jq count outputs echo '[{"username":"user1"},{"username":"user2"}]' | jq '. | length' > 2