Tail is a very useful SSH command to read a file. Its like cat command but it only reads a file. Tail command by default will show last 20 lines of a file.
This will show the last 20 lines of /var/log/messages
tail -f /var/log/messages
This will show last 20 lines of /var/log/messages and will also update while it’s being changed / updated.
tail -100 /var/log/messages
This will show the last 100 lines of /var/log/messages
How to exit from tail command
Simply press following key on your keyboard.