Linux tail command

If you wish to look at the last lines of a file in a Linux environment you should use the Linux tail command. In this article, we’ll show the basic usage of tail

Showing the last 10 lines of a file using tail

tail myTextFile.txt

Showing the last n lines using Linux tail command

Here you should replace n with the number of lines you wish to see

tail -n myTextFile.txt

Watch a file with Linux tail command

This will make tail refresh and display any changes made to the file. It’s useful when watching logs, waiting for an event to occur

tail -F myTextFile.txt
  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

Linux tar Command

The Linux tar command is used to compress and extract files to and from an archive. In this...

Linux top command

If you wish to monitor the performance of your VPS or Dedicated server and track processes, RAM...

Linux ping command

If you wish to test your connection to a server from your Linux system you can use the Linux ping...

Linux file command

The file command is used to check a file’s type and contents in Linux environment. It is most...

Linux export command

When you’re managing your shell’s variables and you wish to save them to your environment you can...