First Two Lines
Tagged with: command, head, line, Linux, tail
Sunday, April 13th, 2008 10:17 PM
View first two lines of a file
head -2 file
tail -2 file # for last 2 lines
View first two lines of a file
head -2 file
tail -2 file # for last 2 lines
View in real time what is added to a file. -f stands for Follow
tail -f /var/log/messages
<p class=”intro”>This command will let you watch a log file for changes as soon as they happen.</p>
<pre><code class=”cli”>
tail -f log/development.log
</code></pre>
[tags]log,listen,watch,tail,command,linux,cli[/tags]