keep-header
Keep first line untouched by a command, passing it directly to stdout
.
More information: https://github.com/eBay/tsv-utils#keep-header.
-
Sort a file and keep the first line at the top:
keep-header {{path/to/file}} -- sort
-
Output first line directly to
stdout
, passing the remainder of the file through the specified command:
keep-header {{path/to/file}} -- {{command}}
-
Read from
stdin
, sorting all except the first line:
cat {{path/to/file}} | keep-header -- {{command}}
-
Grep a file, keeping the first line regardless of the search pattern:
keep-header {{path/to/file}} -- grep {{pattern}}
License and Disclaimer
The content on this page is copyright © 2014—present the tldr-pages team and contributors.This page is used with permission under Creative Commons Attribution 4.0 International License.
While we do attempt to make sure content is accurate, there isn't a warranty of any kind.