mlr --json head -n 1 data.json

Category: Data Science & Analysis

mlr --json head -n 1 data.json

Show the first record of a JSON file

With --json, Miller reads a JSON array of objects and treats it like a table. The head verb prints the first record, here just one with -n 1. This mirrors head for text files but operates on whole records, so one JSON object never gets cut mid-way. Use the tail verb to inspect the last records of the same file.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.