tail

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

解説

オプションなしだと、末尾10行が表示されます。ログファイルの最新エラーを確認するのに便利。

オプション

-n 数値指定した行数だけ表示
-fファイルをリアルタイムで監視(follow)
-数値`-n` を省略した書き方
-c バイト数末尾から指定バイト数だけ表示
1[ERROR] 2026-01-12 09:55:23 Database connection failed: timeout after 30s
2[WARN] 2026-01-12 09:55:24 Retrying database connection (attempt 1/3)
3[ERROR] 2026-01-12 09:55:54 Database connection failed: connection refused
4[WARN] 2026-01-12 09:55:55 Retrying database connection (attempt 2/3)
5[INFO] 2026-01-12 09:56:25 Database connection established
6[ERROR] 2026-01-12 10:15:00 Authentication failed for user: [email protected]
7[WARN] 2026-01-12 10:15:01 Rate limit exceeded for IP: 192.168.1.200
8[ERROR] 2026-01-12 10:30:45 File not found: /uploads/document.pdf
9[ERROR] 2026-01-12 10:45:12 Invalid JSON payload in request body
10[WARN] 2026-01-12 11:00:00 Memory usage above 80% threshold