tail — the last lines and following a log
cheat sheet · Ubuntu 24.04 · GNU coreutils 9.4 https://lab.dimsanych.ru/en/wiki/tail/Cheat sheet
-
tail app.logthe last 10 lines -
tail -n 50 app.logthe last 50 lines -
tail -n +2 data.csveverything from line 2 on -
tail -f /var/log/nginx/error.logfollow; Ctrl+C to quit -
tail -F app.logfollow and survive log rotation -
tail -n 0 -f app.logonly new lines, no old ones -
tail -f a.log b.logtwo files at once, with names -
tail -f app.log | grep --line-buffered ERRORfollow errors only
Options
-n 50 and the short form -50 are the same. The +N in -n +N means "starting
at line N". Full list — man tail.