Skip to Content
gnux

-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

ShortLongValueDefaultMeaning
-n--lines[+]NUMoutput the last NUM lines, instead of the last 10; or use -n +NUM to output starting with line NUM

Examples

tailx -n 50 app.log
tailx -n +2 data.csv
tailx -n 1 a.log b.log && tailx -q -n 1 a.log b.log

Force the header for a single file (--silent is the long spelling of -q)

tailx -v -n 5 app.log
headx -n 20 app.log | tailx -n 10

Print the oldest entry of a directory

lsx -t | tailx -n 1

Print the last entry of a NUL-separated list

tailx -z -n 1 names.lst | xargs -0 echox

Follow a log, printing only lines appended from now on

tailx -n 0 -f app.log

Show 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

On this page