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