$head
Output the first part (top lines) of text files.
head [OPTIONS] [FILE...]Попробуйте в интерактивной песочнице
Клиентская симуляция без установки с мгновенным результатом.
Обзор и принцип работы
`head` outputs the beginning portion of files, displaying the first 10 lines by default. It is ideal for quickly inspecting file headers, CSV schemas, or top log entries without loading massive files into memory.
Основные флаги и параметры команды
| Flag / Option | Description |
|---|---|
| -n [NUM] | Print the first NUM lines instead of the default 10. |
| -c [NUM] | Print the first NUM bytes of each file. |
| -q | Quiet mode; never print headers giving file names. |
Практические примеры использования
head -n 5 /var/log/syslogExtracts and prints only the first 5 lines of the system log file.
Похожие команды Linux
Поиск текстовых шаблонов и регулярных выражений внутри файлов и потоков данных.
Чтение и объединение содержимого файлов с выводом в терминал.
Output the last part (bottom lines) of files or stream real-time logs.
Print newline, word, and byte counts for files.
Print text strings or write data to files using shell redirection.
Stream editor for filtering and transforming text using pattern substitutions.