<p>The tail command is used to print out the last 10 lines of a file to standard out. This command is a staple in a system administrator’s tool kit and especially handy when monitoring log files. The basic syntax is:</p>
<blockquote><p>tail some_file</p></blockquote>
<p>Which will output the last 10 lines of the file. You can alter the number of lines with the -n, or –lines=, flag:</p>
<blockquote><p>tail -n20 some_file<br/>
tail –lines=20 some_file</p></blockquote>
<p>In some versions of tail you can get away with specifying the number of lines from the end with just a “-” and number:</p>
<blockquote><p>tail -30 some_file</p></blockquote>
<p>Instead of working backwards with the -n command you can specify a “+” and some number to start from that number and list the contents to the end:</p>
<blockquote><p>tail -n+30 some_file</p></blockquote>
<p>This will display the contents of some_file from line 30 to the end of the file.
</p>
<p>
For the complete write up including video please go to <a href="https://www.linuxintheshell.com/2012/07/31/episode-012-tail/">https://www.linuxintheshell.com/2012/07/31/episode-012-tail/</a>
</p>
