Command reference

tsvpeek [flags] [file]
FlagArgumentDefaultDescription
-H, --header—offTreat the first parsed row as column names.
--no-header—offForce the first row to be treated as data.
-c, --columnsLISTallSelect comma-separated columns by name or one-based position.
-w, --whereEXPRnoneAdd a row filter. May be specified more than once.
-d, --delimiterCHAR\tSet the input field delimiter.
--output-delimiterCHARinput delimiterSet the delimiter used for non-table output.
--csv—offUse comma-delimited CSV parsing with quoted field handling.
--quoteCHAR"Set the CSV quote character.
--commentCHARnoneIgnore input lines beginning with the specified character.
-n, --limitNunlimitedStop after emitting N matching records.
--offsetN0Skip N matching records before output begins.
-t, --table—offRender output as an aligned terminal table.
--max-widthN40Maximum displayed width of an individual table cell.
--truncateSTRING…Suffix used when a displayed table cell is shortened.
--no-align—offDisable table-column padding.
--sortSPECnoneSort matching rows using column[:num][:asc|desc].
--uniqueLISTnoneEmit only the first record for each selected key.
--count—offPrint the matching row count instead of rows.
--line-number—offPrefix emitted records with the source line number.
--strict—offStop when a malformed record is encountered.
--skip-bad—offSkip malformed records and continue processing.
--expected-fieldsNautomaticRequire each data record to contain N fields.
--emptySTRINGempty stringReplacement text used when displaying empty fields.
--encodingNAMEutf-8Set input encoding. Supported values are documented in the FAQ.
--bufferSIZE1MiBSet the buffered input size.
--colorWHENautoSet diagnostic color mode: auto, always or never.
-q, --quiet—offSuppress non-fatal diagnostic messages.
--version——Print the version and exit.
-h, --help——Print command help and exit.

Filter syntax

column=value
column!=value
column>value
column>=value
column<value
column<=value
column~text
column!~text

Append :num to a column reference to request numeric comparison:

--where 'size:num>=4096'

Sort syntax

name
name:desc
size:num
size:num:desc

Sorting requires matching rows to be retained until input processing is complete.

Size values

The --buffer option accepts integer byte counts or the suffixes KiB, MiB and GiB.