commands
tail — preview final lines
Print final lines (10 by default). -f follows file growth and can run indefinitely; stop with Ctrl+C. -F follows by name with retry on GNU systems. Use bounded previews for static data. Example assumes a fresh text-streams lab fixture.
Formal Syntax & Structure
linux syntaxlinux
tail [OPTION]... [FILE]...Parameters & Attributes
| Name | Type | Description |
|---|---|---|
| -n | option | Line count |
| -f | option | Follow growth |
| FILE | operand | Input file |
Return Value
exit status and output
GNU tail writes the selected final lines or bytes and returns nonzero on errors. A short file can yield fewer lines without error; follow mode continues until stopped or interrupted.
Working Example
Example Snippetlinux
tail -n 2 events.txt