-n, --lines
Output the last NUM lines, instead of the last 10; or use -n +NUM to output starting with line NUM.
An option of tailx.
Usage
tailx -n [+]NUM [FILE]...
tailx --lines=[+]NUM [FILE]...Details
| Short | Long | Value | Default | Meaning |
|---|---|---|---|---|
-n | --lines | [+]NUM | output the last NUM lines, instead of the last 10; or use -n +NUM to output starting with line NUM |
Examples
Print the last 50 lines
tailx -n 50 app.logPrint everything from the second line on (skip a header)
tailx -n +2 data.csvPrint the last line of each log, with and without file name headers
tailx -n 1 a.log b.log && tailx -q -n 1 a.log b.logForce the header for a single file (--silent is the long spelling of -q)
tailx -v -n 5 app.logPrint lines 11 to 20 of a file
headx -n 20 app.log | tailx -n 10Print the oldest entry of a directory
lsx -t | tailx -n 1Print the last entry of a NUL-separated list
tailx -z -n 1 names.lst | xargs -0 echoxFollow a log, printing only lines appended from now on
tailx -n 0 -f app.logShow the end of every log in the portable gnux shell
gnux shell -c 'catx *.log | tailx -n 5'Help in the terminal
gnux help tailx --lines