Sobes.tech
Junior — Middle

What is the function of the tail command in the command line?

sobes.tech AI

Answer from AI

The tail command in the command line is used to output the last lines of a file or data stream. By default, it shows the last 10 lines of the file.

This is useful for viewing the latest entries in logs or other continuously updated files.

Example usage:

tail -n 20 /var/log/syslog  # show the last 20 lines of the syslog file

tail -f /var/log/syslog    # continuously output new lines as they are added (useful for monitoring)