<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>unuix Archives - Linux Windows and android Tutorials</title>
	<atom:link href="https://www.osradar.com/tag/unuix/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.osradar.com</link>
	<description>tutorials and news and Seurity</description>
	<lastBuildDate>Wed, 25 Sep 2019 18:51:57 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=5.8.13</generator>
	<item>
		<title>how to use Linux head and tail commands</title>
		<link>https://www.osradar.com/how-to-use-linux-head-and-tail-commands/</link>
					<comments>https://www.osradar.com/how-to-use-linux-head-and-tail-commands/#respond</comments>
		
		<dc:creator><![CDATA[Muhammad Nabeel]]></dc:creator>
		<pubDate>Tue, 24 Sep 2019 23:12:50 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[CentOS]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[fedora]]></category>
		<category><![CDATA[RHEL]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[unuix]]></category>
		<guid isPermaLink="false">https://www.osradar.com/?p=13860</guid>

					<description><![CDATA[<p>What is Head Command? head is a program on Unix and Unix-like operating systems used to display the beginning of a text file or piped data. What is Tail Command? tail is a program available on Unix, Unix-like systems and FreeDOS used to display the end of a text file or piped data. How to [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://www.osradar.com/how-to-use-linux-head-and-tail-commands/">how to use Linux head and tail commands</a> appeared first on <a rel="nofollow" href="https://www.osradar.com">Linux  Windows and android  Tutorials</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<h3><strong>What is Head Command?</strong></h3>



<p>head is a program on Unix and Unix-like operating systems used to display the beginning of a text file or piped data.</p>



<h3><strong>What is Tail Command?</strong></h3>



<p>tail is a program available on Unix, Unix-like systems and FreeDOS used to display the  end of a text file or piped data.</p>



<h2>How to use Head Command?</h2>



<p>By default head command list first ten lines of a file. In this example i will show you the first ten lines of /etc/shadow file.</p>



<pre class="wp-block-preformatted">head /etc/shadow</pre>



<figure class="wp-block-image"><img loading="lazy" width="1024" height="178" src="//1723336065.rsc.cdn77.org/wp-content/uploads/2019/09/1-20-1024x178.png" alt="" class="wp-image-13863" srcset="https://www.osradar.com/wp-content/uploads/2019/09/1-20-1024x178.png 1024w, https://www.osradar.com/wp-content/uploads/2019/09/1-20-300x52.png 300w, https://www.osradar.com/wp-content/uploads/2019/09/1-20-768x133.png 768w, https://www.osradar.com/wp-content/uploads/2019/09/1-20-696x121.png 696w, https://www.osradar.com/wp-content/uploads/2019/09/1-20-1068x185.png 1068w, https://www.osradar.com/wp-content/uploads/2019/09/1-20.png 1920w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>



<p>See desired number of lines using head command</p>



<p>Now, you will see first 20 lines of /etc/shadow file</p>



<p><strong>-n</strong> used to define lines.<br><strong> 20</strong> it is number of lines</p>



<pre class="wp-block-preformatted">head -n20 /etc/shadow</pre>



<figure class="wp-block-image"><img loading="lazy" width="1024" height="325" src="//1723336065.rsc.cdn77.org/wp-content/uploads/2019/09/2-19-1024x325.png" alt="" class="wp-image-13864" srcset="https://www.osradar.com/wp-content/uploads/2019/09/2-19-1024x325.png 1024w, https://www.osradar.com/wp-content/uploads/2019/09/2-19-300x95.png 300w, https://www.osradar.com/wp-content/uploads/2019/09/2-19-768x244.png 768w, https://www.osradar.com/wp-content/uploads/2019/09/2-19-696x221.png 696w, https://www.osradar.com/wp-content/uploads/2019/09/2-19-1068x339.png 1068w, https://www.osradar.com/wp-content/uploads/2019/09/2-19-1322x420.png 1322w, https://www.osradar.com/wp-content/uploads/2019/09/2-19.png 1920w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>



<h2>How to use Tail Command?</h2>



<p>Like head command, tail is also display 10 lines by default but these are last 10 lines of a file. use following command to list last lines of a file.</p>



<pre class="wp-block-preformatted">tail /etc/shadow</pre>



<figure class="wp-block-image"><img loading="lazy" width="1024" height="181" src="//1723336065.rsc.cdn77.org/wp-content/uploads/2019/09/3-19-1024x181.png" alt="" class="wp-image-13865" srcset="https://www.osradar.com/wp-content/uploads/2019/09/3-19-1024x181.png 1024w, https://www.osradar.com/wp-content/uploads/2019/09/3-19-300x53.png 300w, https://www.osradar.com/wp-content/uploads/2019/09/3-19-768x136.png 768w, https://www.osradar.com/wp-content/uploads/2019/09/3-19-696x123.png 696w, https://www.osradar.com/wp-content/uploads/2019/09/3-19-1068x189.png 1068w, https://www.osradar.com/wp-content/uploads/2019/09/3-19.png 1920w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>



<p>So if you want to see last 20 lines of /etc/shadow file. Then run below command</p>



<pre class="wp-block-preformatted">tail -n20 /etc/shadow</pre>



<figure class="wp-block-image"><img loading="lazy" width="1024" height="320" src="//1723336065.rsc.cdn77.org/wp-content/uploads/2019/09/4-19-1024x320.png" alt="" class="wp-image-13866" srcset="https://www.osradar.com/wp-content/uploads/2019/09/4-19-1024x320.png 1024w, https://www.osradar.com/wp-content/uploads/2019/09/4-19-300x94.png 300w, https://www.osradar.com/wp-content/uploads/2019/09/4-19-768x240.png 768w, https://www.osradar.com/wp-content/uploads/2019/09/4-19-696x218.png 696w, https://www.osradar.com/wp-content/uploads/2019/09/4-19-1068x334.png 1068w, https://www.osradar.com/wp-content/uploads/2019/09/4-19-1344x420.png 1344w, https://www.osradar.com/wp-content/uploads/2019/09/4-19.png 1920w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>



<p>That&#8217;s it</p>
<p>The post <a rel="nofollow" href="https://www.osradar.com/how-to-use-linux-head-and-tail-commands/">how to use Linux head and tail commands</a> appeared first on <a rel="nofollow" href="https://www.osradar.com">Linux  Windows and android  Tutorials</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.osradar.com/how-to-use-linux-head-and-tail-commands/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
