Sobes.tech
Junior

What does the 'tail' command do in the context of working with files in the terminal?

sobes.tech AI

Answer from AI

Outputs the last lines of a file. Often used for viewing logs in real-time or analyzing the latest entries in large files.

Main options:

  • -n <number of lines>: Output the specified number of last lines.
  • -f: Follow the file and output new lines as they appear (commonly used for log monitoring).
  • -c <number of bytes>: Output the specified number of last bytes.

Example of using the -f option for continuous log output:

tail -f /var/log/syslog