← 返回命令列表

Linux command

keep-header 命令

文件

复制后可按需替换文件名、目录或参数。

常用示例

Sort file keeping header

keep-header [file] -- sort

Filter with grep keeping header

keep-header [file] -- grep [pattern]

Pipe through multiple commands

keep-header [file] -- sort | head -20

说明

keep-header preserves the first line (header) of a file while passing the remaining lines through another command. Useful for processing CSV or TSV files where you want to sort or filter data without losing column headers.

FAQ

What is the keep-header command used for?

keep-header preserves the first line (header) of a file while passing the remaining lines through another command. Useful for processing CSV or TSV files where you want to sort or filter data without losing column headers.

How do I run a basic keep-header example?

Run `keep-header [file] -- sort` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

Where can I find more keep-header examples?

This page includes 3 examples for keep-header, plus related commands for nearby Linux tasks.