tail

初級
1/5
user@linux:~/workspace$
tail logs/app.log

Explanation

Shows the last 10 lines of the log file. Since this file is exactly 10 lines, the entire file is printed.

Options

-nDisplay last N lines
-fFollow file in real-time
-cDisplay last N bytes
-FFollow with retry (if file is recreated)
1[INFO] 2026-01-13 09:00:00 Application started
2[DEBUG] 2026-01-13 09:00:05 Loading configuration from config/app.conf
3[INFO] 2026-01-13 09:00:10 Database connection established
4[DEBUG] 2026-01-13 09:00:15 Cache initialized (Redis)
5[INFO] 2026-01-13 09:00:20 Server listening on port 3000
6[WARN] 2026-01-13 09:15:30 High memory usage detected: 85%
7[ERROR] 2026-01-13 09:30:45 Failed to process payment: timeout
8[INFO] 2026-01-13 09:31:00 Payment retry successful
9[DEBUG] 2026-01-13 09:45:00 Processed 1523 requests in last hour
10[INFO] 2026-01-13 10:00:00 Daily backup completed