tail - Print the end of a file
$ tail [-f] [-n number] [file]
tail
prints the specified number
(10 by default) of lines at the end of file
.
-f
, --follow
: Output data as it is written to the file-n number
, --lines number
: Print the specified number of linesfile
: Target file. If unspecified or -
, defaults to the standard input.Print the last 10 lines of README.md:
$ tail README.md
Print the last 42 lines of todo.txt:
$ tail -n42 todo.txt
Print the last lines as they are written to logs.log:
$ tail -f logs.log
head
(1)cat
(1)