Last login: Mon 09 Nov 2026 on tty1
Archived edition.
Ten things the page says. Every one of them is on your machine right now — run the command above and check.
Print the last 10 lines of each FILE to standard output.[man]
output the last NUM bytes; or use -c +NUM to output starting with byte NUM of each file.[man]
output the last NUM lines, instead of the last 10; or use -n +NUM to skip NUM-1 lines at the start.[man]
with --follow=name, reopen a FILE which has not.[man]
with -f, terminate after process ID, PID dies.[man]
keep trying to open a file if it is inaccessible.[man]
with -f, sleep for approximately N seconds (default 1.0) between iterations; with inotify and --pid=P, check process P at least once every N seconds.[man]
With more than one FILE, precede each with a header giving the file name.[man]
With no FILE, or when FILE is -, read standard input.[man]
Mandatory arguments to long options are mandatory for short options too.[man]
Follow a file as it is written
-f is how you watch a log live, and +N is how you skip a header. Ctrl-C is the exit, which the page does not say plainly.
These commands write files, so run them in a scratch directory:
$ mkdir -p ~/motd-lab && cd ~/motd-lab
$ seq 1 20 > log.txt
$ tail -n 3 log.txt
$ tail -n +18 log.txt
$ (sleep 1; echo 'new line' >> log.txt) &
$ tail -f -n 1 log.txt
WHAT YOU SHOULD SEEThe last three lines, then everything from line 18 on, then tail blocks and prints 'new line' when it arrives. Press Ctrl-C to stop.
Five questions, each one taking a term out of a line above. Ten points for each. Tap hear it to have a question read to you; answering plays the verdict.
QUESTION 1 OF 5
Which term completes this line from the page? “Print the last 10 lines of each FILE to _____ output.”
From point 1 above.
QUESTION 2 OF 5
Which term completes this line from the page? “output the last NUM _____, instead of the last 10; or use -n +NUM to skip NUM-1 lines at the start.”
From point 3 above.
QUESTION 3 OF 5
Which term completes this line from the page? “with -f, _____ after process ID, PID dies.”
From point 5 above.
QUESTION 4 OF 5
Which term completes this line from the page? “with -f, sleep for _____ N seconds (default 1.0) between iterations; with inotify and --pid=P, check process P at least once every N seconds.”
From point 7 above.
QUESTION 5 OF 5
Which term completes this line from the page? “With no FILE, or when FILE is -, read standard _____.”
From point 9 above.
Answer all five to bank your points.
Five chapters, three voices. Tap one to jump — the player at the bottom of the screen follows.
Know someone with ten minutes and a terminal? Send them today's page. This is the card that appears when you post it:
The Operator has a dispatch on tail(1),
and he files them for subscribers only. It is free.
Join the club, or read about
the series.
MOTD is a weekday reading of one manual page already installed on your own
machine. Every statement is quoted from that page or from the GNU info
documentation beside it, and every edition names the command that shows you
the source.
archive ·
the operator ·
about ·
podcast ·
Feline Union