2014-07-16 15:50:37 +01:00
|
|
|
# head
|
|
|
|
|
2016-01-07 17:31:27 +00:00
|
|
|
> Output the first part of files.
|
2021-04-01 16:54:26 +01:00
|
|
|
> More information: <https://www.gnu.org/software/coreutils/head>.
|
2014-07-16 15:50:37 +01:00
|
|
|
|
2016-01-07 17:31:27 +00:00
|
|
|
- Output the first few lines of a file:
|
2014-07-16 15:50:37 +01:00
|
|
|
|
2022-01-19 15:21:30 +00:00
|
|
|
`head --lines {{count}} {{path/to/file}}`
|
2014-07-16 15:50:37 +01:00
|
|
|
|
2016-01-07 17:31:27 +00:00
|
|
|
- Output the first few bytes of a file:
|
2014-07-16 15:50:37 +01:00
|
|
|
|
2022-01-19 15:21:30 +00:00
|
|
|
`head --bytes {{count}} {{path/to/file}}`
|
2014-07-16 15:50:37 +01:00
|
|
|
|
2016-01-07 17:31:27 +00:00
|
|
|
- Output everything but the last few lines of a file:
|
2014-07-16 15:50:37 +01:00
|
|
|
|
2022-01-19 15:21:30 +00:00
|
|
|
`head --lines -{{count}} {{path/to/file}}`
|
2014-07-16 15:50:37 +01:00
|
|
|
|
2016-01-07 17:31:27 +00:00
|
|
|
- Output everything but the last few bytes of a file:
|
2014-07-16 15:50:37 +01:00
|
|
|
|
2022-01-19 15:21:30 +00:00
|
|
|
`head --bytes -{{count}} {{path/to/file}}`
|