2023-02-03 05:24:27 +01:00
|
|
|
# head
|
|
|
|
|
|
|
|
> Output the first part of files.
|
2025-01-10 22:27:21 -08:00
|
|
|
> More information: <https://www.gnu.org/software/coreutils/manual/html_node/head-invocation.html>.
|
2023-02-03 05:24:27 +01:00
|
|
|
|
|
|
|
- Output the first few lines of a file:
|
|
|
|
|
2025-03-12 21:05:58 +02:00
|
|
|
`head {{[-n|--lines]}} {{count}} {{path/to/file}}`
|
2023-02-03 05:24:27 +01:00
|
|
|
|
|
|
|
- Output the first few bytes of a file:
|
|
|
|
|
2025-03-12 21:05:58 +02:00
|
|
|
`head {{[-c|--bytes]}} {{count}} {{path/to/file}}`
|
2023-02-03 05:24:27 +01:00
|
|
|
|
|
|
|
- Output everything but the last few lines of a file:
|
|
|
|
|
2025-03-12 21:05:58 +02:00
|
|
|
`head {{[-n|--lines]}} -{{count}} {{path/to/file}}`
|
2023-02-03 05:24:27 +01:00
|
|
|
|
|
|
|
- Output everything but the last few bytes of a file:
|
|
|
|
|
2025-03-12 21:05:58 +02:00
|
|
|
`head {{[-c|--bytes]}} -{{count}} {{path/to/file}}`
|