Forrest logo
back to the tail tool

tail:tldr:603ea

tail: Keep reading file until `Ctrl + C`, even if the file is inaccessible.
$ tail --retry --follow ${filename}
try on your machine

The command "tail --retry --follow ${filename}" is used to continuously display the last few lines of a file, updating the output whenever new lines are added to the file. Here's a breakdown of each component:

  • "tail" is a command used to display the last part of a file.
  • "--retry" is an option for the "tail" command that makes it keep trying to open a file if it is inaccessible or does not exist when the command is initially executed.
  • "--follow" is an option for the "tail" command that causes it to track the file being tailed, and display any new lines that are appended to it in real time.
  • "${filename}" is a placeholder for the actual name of the file you want to tail. You need to replace "${filename}" with the actual file name or its path.

When you execute this command with the appropriate filename, it will continuously display the last few lines of the file, updating the output as new lines are added to the file. If the file is inaccessible or does not exist, it will keep trying to open it until it becomes available or is created.

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