Forrest logo
back to the tail tool

tail:tldr:3a9c7

tail: Print a file from a specific line number.
$ tail --lines +${count} ${filename}
try on your machine

The command you provided is used to display the last part of a file. Here's how it works:

  • tail is the command itself.
  • --lines is an option used to specify the number of lines to display.
  • ${count} is the variable placeholder, where you would provide the number of lines you want to display starting from the end of the file.
  • ${filename} is another variable placeholder, where you would provide the name or path of the file you want to display.

For example, if you want to display the last 10 lines of a file named "example.txt", you would replace ${count} with 10 and ${filename} with "example.txt". The command would look like this:

tail --lines +10 example.txt

This would show the last 10 lines of the "example.txt" file. The + sign before the number indicates that it starts counting from that line number.

If you omit the + sign and only provide the count, like tail -n 10 example.txt, it would display the last 10 lines without including the line number specified.

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