tail
Program: tail
Shows the end of files.
Usage
tail [OPTION]... [FILE]...
Description
Show the end of each FILE, 10 lines unless told otherwise. A FILE named -, or no FILE, means the keyboard or pipe. -NUM as the first argument is the same as -n NUM.
Options in the simulator
11 more options of the real program, not in the simulator yet
Examples
tail -n 3 projects/website/server.log
08:27 GET /favicon.ico 404
08:29 GET /index.html 200
08:30 server stopped tail -n 3 logs/app.log
09:41:02 INFO request served in 84ms
09:41:09 ERROR db timeout after 5000ms
09:41:10 INFO retry ok
head -n 2 logs/app.log
09:12:04 INFO worker 1 started
09:12:04 INFO worker 2 started tail -n 2 logs/app.log
WARN slow response
ERROR payment failed Where you learn it
Lessons
- Looking into files: cat, less, head and tail Terminal start
- Reading logs without drowning Linux Basics, Module 1: Survival basics