tail
The command that prints the last lines of its input, ten by default or as many as -n says.
In more detail
tail -f keeps the file open and prints new lines as they are added, which is how people watch a log file grow. tail -n +2 starts from the second line, skipping a header.
Examples
tail -n 2 poem.txttail -f app.logpython3 dora_metrics.py fixture | tail -3 # just the instability linespython3 dora_metrics.py fixture | tail -3Related terms
- head — The command that prints the first lines of its input, ten by default or as many as -n says.
- pipe — The | operator, which connects one command's standard output to the next command's standard input so they run together.
- sed — The stream editor, which applies editing commands such as find-and-replace to each line of text passing through it.
Taught in
- Pipelines, tee And Process Substitution — Bash Scripting & Command Line Automation
- Instability: Change Fail Rate And Deployment Rework Rate — DevOps & Site Reliability Engineering