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
|
|
|
|
2016-01-04 04:11:03 +00:00
|
|
|
`head -n {{count_of_lines}} {{filename}}`
|
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
|
|
|
|
2016-01-04 04:11:03 +00:00
|
|
|
`head -c {{size_in_bytes}} {{filename}}`
|
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
|
|
|
|
2016-01-04 04:11:03 +00:00
|
|
|
`head -n -{{count_of_lines}} {{filename}}`
|
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
|
|
|
|
2016-01-04 04:11:03 +00:00
|
|
|
`head -c -{{size_in_bytes}} {{filename}}`
|