2022-02-05 12:33:15 +00:00
|
|
|
# tail
|
|
|
|
|
|
|
|
> Display the last part of a file.
|
|
|
|
> See also: `head`.
|
2024-01-31 10:20:27 +00:00
|
|
|
> More information: <https://keith.github.io/tail.1.html>.
|
2022-02-05 12:33:15 +00:00
|
|
|
|
|
|
|
- Show last 'count' lines in file:
|
|
|
|
|
2023-02-20 07:05:58 +00:00
|
|
|
`tail -n {{8}} {{path/to/file}}`
|
2022-02-05 12:33:15 +00:00
|
|
|
|
|
|
|
- Print a file from a specific line number:
|
|
|
|
|
2023-02-20 07:05:58 +00:00
|
|
|
`tail -n +{{8}} {{path/to/file}}`
|
2022-02-05 12:33:15 +00:00
|
|
|
|
|
|
|
- Print a specific count of bytes from the end of a given file:
|
|
|
|
|
2023-02-20 07:05:58 +00:00
|
|
|
`tail -c {{8}} {{path/to/file}}`
|
2022-02-05 12:33:15 +00:00
|
|
|
|
|
|
|
- Print the last lines of a given file and keep reading file until `Ctrl + C`:
|
|
|
|
|
|
|
|
`tail -f {{path/to/file}}`
|
|
|
|
|
|
|
|
- Keep reading file until `Ctrl + C`, even if the file is inaccessible:
|
|
|
|
|
|
|
|
`tail -F {{path/to/file}}`
|
|
|
|
|
|
|
|
- Show last 'count' lines in 'file' and refresh every 'seconds' seconds:
|
|
|
|
|
2023-02-20 07:05:58 +00:00
|
|
|
`tail -n {{8}} -s {{10}} -f {{path/to/file}}`
|