<?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>tail command Archives - Linux Windows and android Tutorials</title>
	<atom:link href="https://www.osradar.com/tag/tail-command/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.osradar.com</link>
	<description>tutorials and news and Seurity</description>
	<lastBuildDate>Mon, 21 Sep 2020 10:59:14 +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 run the Linux Tail command in Windows 10.</title>
		<link>https://www.osradar.com/how-to-run-the-linux-tail-command-in-windows-10/</link>
					<comments>https://www.osradar.com/how-to-run-the-linux-tail-command-in-windows-10/#respond</comments>
		
		<dc:creator><![CDATA[roger]]></dc:creator>
		<pubDate>Sun, 20 Sep 2020 21:55:38 +0000</pubDate>
				<category><![CDATA[Applications]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[tail command]]></category>
		<category><![CDATA[tail command in windows]]></category>
		<category><![CDATA[wait]]></category>
		<guid isPermaLink="false">https://www.osradar.com/?p=23660</guid>

					<description><![CDATA[<p>Hi! The title of this post may seem incongruous, but it&#8217;s not. In fact, for some time Microsoft has approached positions with GNU/Linux. Even, Microsoft&#8217;s operating system has included a Linux subsystem to run inside Windows. But today we will see a slightly different approach. That is, we will talk a little about a Linux [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://www.osradar.com/how-to-run-the-linux-tail-command-in-windows-10/">How to run the Linux Tail command in Windows 10.</a> appeared first on <a rel="nofollow" href="https://www.osradar.com">Linux  Windows and android  Tutorials</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>Hi! The title of this post may seem incongruous, but it&#8217;s not. In fact, for some time Microsoft has approached positions with <a href="https://www.gnu.org/" target="_blank" rel="noreferrer noopener">GNU</a>/Linux. Even, Microsoft&#8217;s operating system has included a <a href="https://www.osradar.com/how-to-install-ubuntu-20-04-lts-on-windows-10/" target="_blank" rel="noreferrer noopener">Linux subsystem</a> to run inside Windows. But today we will see a slightly different approach. That is, we will talk a little about a Linux command itself. And how to apply an alternative within Windows 10. Specifically, we will see how run the Linux Tail command in Windows 10.</p>



<h2>Brief definition of the Tail command.</h2>



<p>When working with Linux commands, commands that print certain parts of files are used. In effect, there are <em>head</em> and <em>tail</em> commands that define the beginning and end of a file or command. In the specific case of the tail command, it allows the user to read the final commands of a file. It is also useful for monitoring new updated information in real time in a specific file. Consequently, the verification of the last entries in the system is facilitated. In addition, users can also view multiple files using a tail command.</p>



<figure class="wp-block-image size-large"><img loading="lazy" width="998" height="1024" src="//1081754738.rsc.cdn77.org/wp-content/uploads/2020/09/tux-158547_1280-1-998x1024.png" alt="" class="wp-image-23662" srcset="https://www.osradar.com/wp-content/uploads/2020/09/tux-158547_1280-1-998x1024.png 998w, https://www.osradar.com/wp-content/uploads/2020/09/tux-158547_1280-1-293x300.png 293w, https://www.osradar.com/wp-content/uploads/2020/09/tux-158547_1280-1-768x788.png 768w, https://www.osradar.com/wp-content/uploads/2020/09/tux-158547_1280-1-696x714.png 696w, https://www.osradar.com/wp-content/uploads/2020/09/tux-158547_1280-1-1068x1095.png 1068w, https://www.osradar.com/wp-content/uploads/2020/09/tux-158547_1280-1.png 1248w" sizes="(max-width: 998px) 100vw, 998px" /></figure>



<h2>The best alternative for Tail in Windows, is present in the operating system itself.</h2>



<p>As you can see, this command is very useful. However, being exclusive to the GNU/Linux ecosystem, it is logical that Windows users need an equivalent. In fact, there are some alternatives with installers and graphic environment. Such as Wintail. However,  it is full of bugs when working with large files. In addition, it often shows old file logs. For this reason I do not recommend it. Other options like GnuWin32tail or Cygwin also give errors. But don&#8217;t worry because the solution is in the house. Just launch a PowerShell and use the following syntax:</p>



<pre class="wp-block-preformatted">Get-Content myfile -Wait</pre>



<figure class="wp-block-image size-large"><img loading="lazy" width="1024" height="221" src="//1081754738.rsc.cdn77.org/wp-content/uploads/2020/09/TAIL-1024x221.png" alt="" class="wp-image-23664" srcset="https://www.osradar.com/wp-content/uploads/2020/09/TAIL-1024x221.png 1024w, https://www.osradar.com/wp-content/uploads/2020/09/TAIL-300x65.png 300w, https://www.osradar.com/wp-content/uploads/2020/09/TAIL-768x166.png 768w, https://www.osradar.com/wp-content/uploads/2020/09/TAIL-696x150.png 696w, https://www.osradar.com/wp-content/uploads/2020/09/TAIL-1068x230.png 1068w, https://www.osradar.com/wp-content/uploads/2020/09/TAIL.png 1219w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>



<p>Please remember a couple of things. First, replace myfile with the name of the file to be obtained. Additionally, you must run the PowerShell from the location of the file or specify it in the command. And this is all! In this simple way we have seen how to run the Linux Tail command in Windows 10. So if you use the Microsoft operating system, you also have this alternative. I hope you enjoyed the post, please stay tuned for our next news. Greetings!</p>
<p>The post <a rel="nofollow" href="https://www.osradar.com/how-to-run-the-linux-tail-command-in-windows-10/">How to run the Linux Tail command in Windows 10.</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-run-the-linux-tail-command-in-windows-10/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>The Linux tail command</title>
		<link>https://www.osradar.com/the-linux-tail-command/</link>
					<comments>https://www.osradar.com/the-linux-tail-command/#respond</comments>
		
		<dc:creator><![CDATA[angeloma]]></dc:creator>
		<pubDate>Mon, 24 Feb 2020 00:11:00 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Servers]]></category>
		<category><![CDATA[Unix]]></category>
		<category><![CDATA[linux command]]></category>
		<category><![CDATA[tail]]></category>
		<category><![CDATA[tail command]]></category>
		<category><![CDATA[terminal]]></category>
		<guid isPermaLink="false">https://www.osradar.com/?p=18387</guid>

					<description><![CDATA[<p>Hey, buddy. This time we will explain in detail the Linux tail command. Quite used by many sysadmin. One of the most feared tools for newcomers is the Linux terminal. However, its use is decreasing every day thanks to the incredible improvements that the system has received. But in the administration of servers, there are [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://www.osradar.com/the-linux-tail-command/">The Linux tail command</a> appeared first on <a rel="nofollow" href="https://www.osradar.com">Linux  Windows and android  Tutorials</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>Hey, buddy. This time we will explain in detail the Linux tail command. Quite used by many <a href="https://www.osradar.com/tag/sysadmin" target="_blank" rel="noreferrer noopener" aria-label="sysadmin (opens in a new tab)">sysadmin</a>.</p>



<p>One of the most feared tools for newcomers is the <a href="https://www.osradar.com/tag/linux" target="_blank" rel="noreferrer noopener" aria-label="Linux (opens in a new tab)">Linux</a> terminal. However, its use is decreasing every day thanks to the incredible improvements that the system has received. But in the administration of servers, there are no graphical interfaces to manage the system, for security reasons. So it&#8217;s up to you to familiarize yourself with the console and the commands.</p>



<p>And if we talk about commands there are many, but many syadmins use some more than the novice users. Tail is one of them and today we will help you to use it and tell you what it is used for.</p>



<h2>The Tail command</h2>



<p><a href="https://www.gnu.org/software/coreutils/" target="_blank" rel="noreferrer noopener" aria-label="Tail (opens in a new tab)">Tail</a> is a command to show the last lines of a text file. It is quite useful for exploring log files that generate services on Linux. Also, it is used to monitor changes that may have happened to this file.</p>



<pre class="wp-block-preformatted">:~$ tail [OPTION]… [FILE]…</pre>



<p>Of course, this syntax is the basic form of usage. The behavior of the command is modifiable thanks to the options it has. To see them, use this command:</p>



<pre class="wp-block-preformatted">:~$ tail --help</pre>



<figure class="wp-block-image size-large is-resized"><img loading="lazy" src="https://www.osradar.com/wp-content/uploads/2020/02/1-13.png" alt="1.- The tail command help" class="wp-image-18388" width="696" height="413" srcset="https://www.osradar.com/wp-content/uploads/2020/02/1-13.png 936w, https://www.osradar.com/wp-content/uploads/2020/02/1-13-300x178.png 300w, https://www.osradar.com/wp-content/uploads/2020/02/1-13-768x456.png 768w, https://www.osradar.com/wp-content/uploads/2020/02/1-13-696x413.png 696w, https://www.osradar.com/wp-content/uploads/2020/02/1-13-707x420.png 707w" sizes="(max-width: 696px) 100vw, 696px" /><figcaption>1.- The tail command help</figcaption></figure>



<p>However, I will explain with some examples of how easy and useful it is to use the Tail command.</p>



<h2>Using the Linux tail command &#8211; examples</h2>



<p>First, I created a text file containing several random names for this example. It is called <code>example.txt</code> and has the following content:</p>



<figure class="wp-block-image size-large"><img loading="lazy" width="791" height="297" src="https://www.osradar.com/wp-content/uploads/2020/02/2-12.png" alt="2.- Example file" class="wp-image-18389" srcset="https://www.osradar.com/wp-content/uploads/2020/02/2-12.png 791w, https://www.osradar.com/wp-content/uploads/2020/02/2-12-300x113.png 300w, https://www.osradar.com/wp-content/uploads/2020/02/2-12-768x288.png 768w, https://www.osradar.com/wp-content/uploads/2020/02/2-12-696x261.png 696w" sizes="(max-width: 791px) 100vw, 791px" /><figcaption>2.- Example file</figcaption></figure>



<p>Now let&#8217;s get started.</p>



<p>To display the last 10 lines of the file, just use the following command:</p>



<pre class="wp-block-preformatted">:~$ tail example.txt
tom
david
joseph
clancy
richard
robert
henry
harry
paul</pre>



<figure class="wp-block-image size-large"><img loading="lazy" width="508" height="226" src="https://www.osradar.com/wp-content/uploads/2020/02/3-10.png" alt="3.- Using the Linux tail command" class="wp-image-18390" srcset="https://www.osradar.com/wp-content/uploads/2020/02/3-10.png 508w, https://www.osradar.com/wp-content/uploads/2020/02/3-10-300x133.png 300w" sizes="(max-width: 508px) 100vw, 508px" /><figcaption>3.- Using the Linux tail command</figcaption></figure>



<p>This is the most basic use of the command.</p>



<p>However, it is possible to change this behavior. For example, we can indicate how many lines to show. If we want to show the last 3 lines, just use it:</p>



<pre class="wp-block-preformatted">:~$ tail -n 3 example.txt
harry
paul
</pre>



<figure class="wp-block-image size-large"><img loading="lazy" width="767" height="125" src="https://www.osradar.com/wp-content/uploads/2020/02/4-9.png" alt="4.- using the command with options" class="wp-image-18391" srcset="https://www.osradar.com/wp-content/uploads/2020/02/4-9.png 767w, https://www.osradar.com/wp-content/uploads/2020/02/4-9-300x49.png 300w, https://www.osradar.com/wp-content/uploads/2020/02/4-9-696x113.png 696w" sizes="(max-width: 767px) 100vw, 767px" /><figcaption>4.- using the command with options</figcaption></figure>



<p>Simply replace the 3 with the number you want to display. Remember we&#8217;re always talking about the last few lines of the file.</p>



<p>On the other hand, we can show the lines that are after a specific line. For example, to show the lines after the 7th line:</p>



<pre class="wp-block-preformatted">:~$ tail +7 example.txt
clancy
richard
robert
henry
harry
paul
</pre>



<figure class="wp-block-image size-large"><img loading="lazy" width="368" height="128" src="https://www.osradar.com/wp-content/uploads/2020/02/5-9.png" alt="5.- The tail command" class="wp-image-18392" srcset="https://www.osradar.com/wp-content/uploads/2020/02/5-9.png 368w, https://www.osradar.com/wp-content/uploads/2020/02/5-9-300x104.png 300w" sizes="(max-width: 368px) 100vw, 368px" /><figcaption>5.- The tail command</figcaption></figure>



<p>It&#8217;s super useful this option.</p>



<p>However, sysadmin uses this command to monitor log files. And it is possible to do it in real-time using the -f option. That is, the last lines of the file are displayed, but as it is modified, the output will be updated:</p>



<pre class="wp-block-preformatted">:~$ tail -f example.txt</pre>



<figure class="wp-block-image size-large"><img loading="lazy" width="733" height="220" src="https://www.osradar.com/wp-content/uploads/2020/02/6-7.png" alt="6.- Monitoring files with tail" class="wp-image-18393" srcset="https://www.osradar.com/wp-content/uploads/2020/02/6-7.png 733w, https://www.osradar.com/wp-content/uploads/2020/02/6-7-300x90.png 300w, https://www.osradar.com/wp-content/uploads/2020/02/6-7-696x209.png 696w" sizes="(max-width: 733px) 100vw, 733px" /><figcaption>6.- Monitoring files with tail</figcaption></figure>



<p>Tail will monitor the file constantly, so press CTRL + C to exit.</p>



<p>Finally, you can display the command version as follows:</p>



<pre class="wp-block-preformatted">:~$ tail --version
tail (GNU coreutils) 8.28
 Copyright (C) 2017 Free Software Foundation, Inc.
 License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html.
 This is free software: you are free to change and redistribute it.
 There is NO WARRANTY, to the extent permitted by law.
 Written by Paul Rubin, David MacKenzie, Ian Lance Taylor,
 and Jim Meyering.</pre>



<p>And that is it.</p>



<h2>Conclusion</h2>



<p>The Tail command is a very useful terminal command. Widely used by many sysadmin for daily work it is also used for all those who wish to quickly view the contents of a file. Thanks to the examples, shown, you can see the potential of it and take advantage of it.</p>



<p>Please share this post and join <a href="https://t.me/osradar" target="_blank" rel="noreferrer noopener" aria-label="our Telegram channel (opens in a new tab)">our Telegram channel</a>.</p>
<p>The post <a rel="nofollow" href="https://www.osradar.com/the-linux-tail-command/">The Linux tail command</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/the-linux-tail-command/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
