tldr/pages/common/head.md

21 lines
475 B
Markdown
Raw Normal View History

2014-07-16 15:50:37 +01:00
# head
> Output the first part of files.
> More information: <https://www.gnu.org/software/coreutils/head>.
2014-07-16 15:50:37 +01: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
- 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
- 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
- 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}}`