Forrest logo
back to the tail tool

tail:tldr:67262

tail: Show last 'num' lines in 'file' and refresh every 'n' seconds.
$ tail --lines ${count} --sleep-interval ${seconds} --follow ${filename}
try on your machine

The command "tail --lines ${count} --sleep-interval ${seconds} --follow ${filename}" is used to display the last few lines of a file and continue following the file as new lines are added.

Here is the breakdown of each part of the command:

  • "tail" is the command itself, used to display the last part of a file.
  • "--lines ${count}" specifies the number of lines from the end of the file to display. The "${count}" should be replaced with the desired number of lines.
  • "--sleep-interval ${seconds}" sets the time interval between checks for new lines in the file. The "${seconds}" should be replaced with the desired number of seconds.
  • "--follow" tells the "tail" command to continuously monitor the file for new lines and display them on the screen.
  • "${filename}" is the name of the file that is being monitored by the "tail" command. It should be replaced with the actual file name.

By using this command, you will be able to view the last few lines of a file, and as new lines are added to the file, they will be continuously displayed on the screen.

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the tail tool