Skip to content
zero2vibecodelearn vibe coding

What tail -n does

tail -n 20 log.txt: Show the last 20 lines of a file — handy for logs.

The tail command page covers what it does in general, with an example.

tail-n20log.txt
  • tail— command — last lines of a file
  • -n— flag — how many lines
  • 20— how many lines
  • log.txt— argument: a file, a folder, or text

What it does when you run it

$ tail -n 20 log.txt
ok start
error: disk full
ok done
error: retry
ok finished

Run it yourself

The same files. Nothing here can break, and nothing leaves your browser.

Explain other commands

Written by Mikhail Kuzmitskii