<?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>cli Archives - Linux Windows and android Tutorials</title>
	<atom:link href="https://www.osradar.com/tag/cli/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.osradar.com</link>
	<description>tutorials and news and Seurity</description>
	<lastBuildDate>Fri, 16 Jul 2021 16:25:16 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=5.8.12</generator>
	<item>
		<title>Monitoring your network with Nethogs on Ubuntu 20.04</title>
		<link>https://www.osradar.com/install-nethogs-ubuntu/</link>
					<comments>https://www.osradar.com/install-nethogs-ubuntu/#respond</comments>
		
		<dc:creator><![CDATA[angeloma]]></dc:creator>
		<pubDate>Wed, 21 Jul 2021 08:20:00 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[cli]]></category>
		<category><![CDATA[focal]]></category>
		<category><![CDATA[Focal Fossa]]></category>
		<category><![CDATA[nethogs]]></category>
		<category><![CDATA[server]]></category>
		<category><![CDATA[ubuntu]]></category>
		<guid isPermaLink="false">https://www.osradar.com/?p=31263</guid>

					<description><![CDATA[<p>Hello friends. Monitoring the network can be a very useful thing to do and can find problems. Besides that, it is always good to keep track of network usage. Therefore, we will show you how to install and use Nethogs on Ubuntu 20.04. This simple tool allows you to track network usage. In the Github [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://www.osradar.com/install-nethogs-ubuntu/">Monitoring your network with Nethogs on Ubuntu 20.04</a> appeared first on <a rel="nofollow" href="https://www.osradar.com">Linux  Windows and android  Tutorials</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p class="has-line-data">Hello friends. Monitoring the network can be a very useful thing to do and can find problems. Besides that, it is always good to keep track of network usage. Therefore, we will show you how to install and use Nethogs on Ubuntu 20.04. This simple tool allows you to track network usage.</p>



<p class="has-line-data">In the <a href="https://github.com/raboof/nethogs">Github profile</a> of this tool, we find the following definition</p>



<blockquote class="wp-block-quote"><p class="has-line-data" data-line-start="4" data-line-end="5">NetHogs is a small ‘net top’ tool. Instead of breaking the traffic down per protocol or per subnet, like most tools do, it groups bandwidth by process.</p></blockquote>



<p class="has-line-data">Thanks to this tool, we can find out which processes and applications consume the most bandwidth. In administrative situations, it is quite useful to identify network abuses.</p>



<p class="has-line-data">Since NetHogs heavily relies on /proc, most features are only available on Linux. NetHogs can be built on Mac OS X and FreeBSD, but it will only show connections, not processes.</p>



<p class="has-line-data">So, let’s get started.</p>



<h2 class="code-line"><a id="Install_Nethogs_on_Ubuntu_2004_12"></a>Install Nethogs on Ubuntu 20.04</h2>



<p class="has-line-data">Nethogs is a mature piece of software included in most Linux distributions. And this includes Ubuntu 20.04 and derivatives, so to install it, just run the following command</p>



<pre class="wp-block-preformatted">sudo apt update
sudo apt install nethogs</pre>



<p class="has-line-data">This way we will be able to use it from the terminal.</p>



<h2 class="code-line"><a id="Using_Nethogs_on_Ubuntu_2004_21"></a>Using Nethogs on Ubuntu 20.04</h2>



<p class="has-line-data">The most common way to use it is simply to run it with root permissions as follows:</p>



<pre class="wp-block-preformatted">sudo nethogs</pre>



<p class="has-line-data">There you will notice how the set of applications that are using the network are grouped by processes.</p>



<p class="has-line-data">It is useful to give the program a refresh rate. This rate is measured in seconds and can be specified with the <code>-d</code> option. For example to indicate that every 5 seconds the monitoring should be refreshed.</p>



<pre class="wp-block-preformatted">sudo nethogs -d 5</pre>



<p class="has-line-data">Another useful thing to do is to specify which network interface to monitor.</p>



<pre class="wp-block-preformatted">sudo nethogs -d 5 eth1</pre>



<p class="has-line-data">This way only the network interface <code>eth1</code> is taken into account, but you can also add more than one.</p>



<pre class="wp-block-preformatted">sudo nethogs -d eth1 eth2</pre>



<p class="has-line-data">As you can see, it is quite simple to use.</p>



<p class="has-line-data">Also, you can install a graphical interface called <code>nethogs-qt</code> for better integration.</p>



<h2 class="code-line"><a id="Conclusion_45"></a>Conclusion</h2>



<p class="has-line-data">These kinds of tools, although simple, can be very useful to see which application consumes a lot of bandwidth. This is useful in a home environment but in a production environment, it can be vital.</p>



<p class="has-line-data">Enjoy it.</p>
<p>The post <a rel="nofollow" href="https://www.osradar.com/install-nethogs-ubuntu/">Monitoring your network with Nethogs on Ubuntu 20.04</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/install-nethogs-ubuntu/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Protect your files from accidental deletion</title>
		<link>https://www.osradar.com/protect-your-files-from-accidental-deletion/</link>
					<comments>https://www.osradar.com/protect-your-files-from-accidental-deletion/#respond</comments>
		
		<dc:creator><![CDATA[angeloma]]></dc:creator>
		<pubDate>Wed, 06 Feb 2019 06:19:35 +0000</pubDate>
				<category><![CDATA[Featured]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[cli]]></category>
		<category><![CDATA[data]]></category>
		<category><![CDATA[Sysadmin]]></category>
		<category><![CDATA[terminal]]></category>
		<category><![CDATA[tools]]></category>
		<category><![CDATA[Tutorial]]></category>
		<guid isPermaLink="false">https://www.osradar.com/?p=10535</guid>

					<description><![CDATA[<p>It seems like a lie but if you work a long time with the Linux terminal, it is very likely that at some point you will have to delete several files. And that is where the problem comes in, you can make a mistake and delete some very important files or even an entire partition. [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://www.osradar.com/protect-your-files-from-accidental-deletion/">Protect your files from accidental deletion</a> appeared first on <a rel="nofollow" href="https://www.osradar.com">Linux  Windows and android  Tutorials</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>It seems like a lie but if you work a long time with the Linux terminal, it is very likely that at some point you will have to delete several files. And that is where the problem comes in, you can make a mistake and delete some very important files or even an entire partition. So for that, today I will teach you how to protect your files from accidental deletion, with this you can work safer with your files safe.</p>
<p>To do it I present you two very simple methods to do it, one consists of using an external program for it. The other method is with a command that normally comes installed on all Linux distributions.</p>
<p>So, let us start.</p>
<h2>1. Protect your files using rm-protection</h2>
<p>rm-protection is a small program similar to an rm extension that protects your files from accidental deletion. The program can be installed via PIP so there should be no problem with it.</p>
<p>First, you need to install PIP.</p>
<p>If you use Debian, Ubuntu, Linux Mint or derivate:</p>
<pre class="">$ sudo apt install python-pip
$ sudo apt-get install python-setuptools</pre>
<p><figure id="attachment_10536" aria-describedby="caption-attachment-10536" style="width: 815px" class="wp-caption alignnone"><img loading="lazy" class="size-full wp-image-10536" src="https://www.osradar.com/wp-content/uploads/2019/02/1-3.png" alt="1.- Install python-pip" width="815" height="344" srcset="https://www.osradar.com/wp-content/uploads/2019/02/1-3.png 815w, https://www.osradar.com/wp-content/uploads/2019/02/1-3-300x127.png 300w, https://www.osradar.com/wp-content/uploads/2019/02/1-3-768x324.png 768w, https://www.osradar.com/wp-content/uploads/2019/02/1-3-696x294.png 696w" sizes="(max-width: 815px) 100vw, 815px" /><figcaption id="caption-attachment-10536" class="wp-caption-text">1.- Install python-pip</figcaption></figure></p>
<p>In case you are using Arch Linux or derivates, you can install it with this command:</p>
<pre class="">:~$ sudo pacman -S pyhton-pip</pre>
<p>On CentOS 7 and RHEL:</p>
<pre class="">:~$ su
:~# yum install epel-release
:~# yum install python-pip</pre>
<p>Next, install rm-protection.</p>
<pre class="">:~$ sudo -H pip install rm-protection</pre>
<p><figure id="attachment_10537" aria-describedby="caption-attachment-10537" style="width: 477px" class="wp-caption alignnone"><img loading="lazy" class="size-full wp-image-10537" src="https://www.osradar.com/wp-content/uploads/2019/02/2-3.png" alt="2.- install rm-protection" width="477" height="123" srcset="https://www.osradar.com/wp-content/uploads/2019/02/2-3.png 477w, https://www.osradar.com/wp-content/uploads/2019/02/2-3-300x77.png 300w" sizes="(max-width: 477px) 100vw, 477px" /><figcaption id="caption-attachment-10537" class="wp-caption-text">2.- install rm-protection</figcaption></figure></p>
<p>Next, use the command to protect your file. For example, I have one file called examplerm.txt.</p>
<pre class="">:~$ protect examplerm.txt</pre>
<p><figure id="attachment_10539" aria-describedby="caption-attachment-10539" style="width: 800px" class="wp-caption alignnone"><img loading="lazy" class="size-full wp-image-10539" src="https://www.osradar.com/wp-content/uploads/2019/02/3-333.png" alt="3- protect your files using rm-protection" width="800" height="188" srcset="https://www.osradar.com/wp-content/uploads/2019/02/3-333.png 800w, https://www.osradar.com/wp-content/uploads/2019/02/3-333-300x71.png 300w, https://www.osradar.com/wp-content/uploads/2019/02/3-333-768x180.png 768w, https://www.osradar.com/wp-content/uploads/2019/02/3-333-696x164.png 696w" sizes="(max-width: 800px) 100vw, 800px" /><figcaption id="caption-attachment-10539" class="wp-caption-text">3- protect your files using rm-protection</figcaption></figure></p>
<p>Then, the tool will ask your to set a question and answer. If you want to eliminate it, it will ask you a question and you must answer it correctly.</p>
<p>Now, try to remove it.</p>
<pre class="">:~$ rm-p example.txt</pre>
<p>You will see this:</p>
<p><figure id="attachment_10540" aria-describedby="caption-attachment-10540" style="width: 833px" class="wp-caption alignnone"><img loading="lazy" class="size-full wp-image-10540" src="https://www.osradar.com/wp-content/uploads/2019/02/4-2.png" alt="4.- The questions" width="833" height="160" srcset="https://www.osradar.com/wp-content/uploads/2019/02/4-2.png 833w, https://www.osradar.com/wp-content/uploads/2019/02/4-2-300x58.png 300w, https://www.osradar.com/wp-content/uploads/2019/02/4-2-768x148.png 768w, https://www.osradar.com/wp-content/uploads/2019/02/4-2-696x134.png 696w" sizes="(max-width: 833px) 100vw, 833px" /><figcaption id="caption-attachment-10540" class="wp-caption-text">4.- The questions</figcaption></figure></p>
<p>As you can see, you have to answer the question. If you don not answer the question correctly, the program will not allow you to remove the file.</p>
<p><figure id="attachment_10541" aria-describedby="caption-attachment-10541" style="width: 811px" class="wp-caption alignnone"><img loading="lazy" class="size-full wp-image-10541" src="https://www.osradar.com/wp-content/uploads/2019/02/5-3.png" alt="5.- Wrong answer" width="811" height="227" srcset="https://www.osradar.com/wp-content/uploads/2019/02/5-3.png 811w, https://www.osradar.com/wp-content/uploads/2019/02/5-3-300x84.png 300w, https://www.osradar.com/wp-content/uploads/2019/02/5-3-768x215.png 768w, https://www.osradar.com/wp-content/uploads/2019/02/5-3-696x195.png 696w" sizes="(max-width: 811px) 100vw, 811px" /><figcaption id="caption-attachment-10541" class="wp-caption-text">5.- Wrong answer</figcaption></figure></p>
<p>However, if you type the answer, then you will remove it.</p>
<p><figure id="attachment_10542" aria-describedby="caption-attachment-10542" style="width: 763px" class="wp-caption alignnone"><img loading="lazy" class="size-full wp-image-10542" src="https://www.osradar.com/wp-content/uploads/2019/02/6-3.png" alt="6.- Deleting a file" width="763" height="149" srcset="https://www.osradar.com/wp-content/uploads/2019/02/6-3.png 763w, https://www.osradar.com/wp-content/uploads/2019/02/6-3-300x59.png 300w, https://www.osradar.com/wp-content/uploads/2019/02/6-3-696x136.png 696w" sizes="(max-width: 763px) 100vw, 763px" /><figcaption id="caption-attachment-10542" class="wp-caption-text">6.- Deleting a file</figcaption></figure></p>
<p>The script is very good, but not infallible. The root user can delete without knowing the answer to the question, just as if the user knows the answer as well. Use it more than anything to avoid accidents, not to give security to the system.</p>
<p>If you want more security, I recommend to you create a Alias and change rm for rm-p.</p>
<h2>2.- Protect your files using the chattr command</h2>
<p>The second form is somewhat more drastic than the first and is using the chattr command. It is a command available on almost all Linux distributions.</p>
<p>Its usage is like this:</p>
<pre class="">:~$ chattr [-pRVf] [-+=aAcCdDeijPsStTu] [-v version] files</pre>
<p>Do not worry, it is too easy to use it.</p>
<p>For example, I will protect one file called examplechattr.txt.</p>
<pre class="">:~$ sudo chattr +i examplechattr.txt</pre>
<p>&nbsp;</p>
<p><figure id="attachment_10543" aria-describedby="caption-attachment-10543" style="width: 779px" class="wp-caption alignnone"><img loading="lazy" class="size-full wp-image-10543" src="https://www.osradar.com/wp-content/uploads/2019/02/7-3.png" alt="7.- Protect a file using chattr" width="779" height="231" srcset="https://www.osradar.com/wp-content/uploads/2019/02/7-3.png 779w, https://www.osradar.com/wp-content/uploads/2019/02/7-3-300x89.png 300w, https://www.osradar.com/wp-content/uploads/2019/02/7-3-768x228.png 768w, https://www.osradar.com/wp-content/uploads/2019/02/7-3-696x206.png 696w" sizes="(max-width: 779px) 100vw, 779px" /><figcaption id="caption-attachment-10543" class="wp-caption-text">7.- Protect a file using chattr</figcaption></figure></p>
<p>I&#8217;ll explain briefly. Chattr has an operator like + that adds a feature or &#8211; that removes it. Option i indicates that the file is immutable, i.e. it cannot be deleted.</p>
<p>&nbsp;</p>
<p>Let us try to remove it.</p>
<p><figure id="attachment_10544" aria-describedby="caption-attachment-10544" style="width: 777px" class="wp-caption alignnone"><img loading="lazy" class="size-full wp-image-10544" src="https://www.osradar.com/wp-content/uploads/2019/02/8-3.png" alt="8.- The file is protected" width="777" height="237" srcset="https://www.osradar.com/wp-content/uploads/2019/02/8-3.png 777w, https://www.osradar.com/wp-content/uploads/2019/02/8-3-300x92.png 300w, https://www.osradar.com/wp-content/uploads/2019/02/8-3-768x234.png 768w, https://www.osradar.com/wp-content/uploads/2019/02/8-3-696x212.png 696w" sizes="(max-width: 777px) 100vw, 777px" /><figcaption id="caption-attachment-10544" class="wp-caption-text">8.- The file is protected</figcaption></figure></p>
<p>As you can see, even the root user is not allowed to remove the file.</p>
<p>If you want to remove this attribute, you can do so with this command:</p>
<pre class="">:~$ sudo chattr -i examplechattr.txt</pre>
<p><figure id="attachment_10545" aria-describedby="caption-attachment-10545" style="width: 799px" class="wp-caption alignnone"><img loading="lazy" class="size-full wp-image-10545" src="https://www.osradar.com/wp-content/uploads/2019/02/9-3.png" alt="9.- Revoke the i attribute" width="799" height="121" srcset="https://www.osradar.com/wp-content/uploads/2019/02/9-3.png 799w, https://www.osradar.com/wp-content/uploads/2019/02/9-3-300x45.png 300w, https://www.osradar.com/wp-content/uploads/2019/02/9-3-768x116.png 768w, https://www.osradar.com/wp-content/uploads/2019/02/9-3-696x105.png 696w" sizes="(max-width: 799px) 100vw, 799px" /><figcaption id="caption-attachment-10545" class="wp-caption-text">9.- Revoke the i attribute</figcaption></figure></p>
<p>Now, you can delete it.</p>
<p>The same way you can protect entire folders. For example:</p>
<pre class="">:~$ sudo chattr -R +i Example/</pre>
<p><figure id="attachment_10546" aria-describedby="caption-attachment-10546" style="width: 779px" class="wp-caption alignnone"><img loading="lazy" class="size-full wp-image-10546" src="https://www.osradar.com/wp-content/uploads/2019/02/10-3.png" alt="10.- Protecting a folder" width="779" height="226" srcset="https://www.osradar.com/wp-content/uploads/2019/02/10-3.png 779w, https://www.osradar.com/wp-content/uploads/2019/02/10-3-300x87.png 300w, https://www.osradar.com/wp-content/uploads/2019/02/10-3-768x223.png 768w, https://www.osradar.com/wp-content/uploads/2019/02/10-3-696x202.png 696w" sizes="(max-width: 779px) 100vw, 779px" /><figcaption id="caption-attachment-10546" class="wp-caption-text">10.- Protecting a folder</figcaption></figure></p>
<p>To revoke it</p>
<pre class="">:~$ sudo chattr -R -i Example/</pre>
<p>So, that&#8217;s it.</p>
<h2>Conclusion</h2>
<p>The protection of data and files is an essential task of a sysadmin, for it there are two very simple ways to do it.</p>
<p>Please share this post with your friends.</p>
<p>The post <a rel="nofollow" href="https://www.osradar.com/protect-your-files-from-accidental-deletion/">Protect your files from accidental deletion</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/protect-your-files-from-accidental-deletion/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Using Gotop a graphical system monitor</title>
		<link>https://www.osradar.com/using-gotop-a-graphical-system-monitor/</link>
					<comments>https://www.osradar.com/using-gotop-a-graphical-system-monitor/#respond</comments>
		
		<dc:creator><![CDATA[angeloma]]></dc:creator>
		<pubDate>Mon, 04 Feb 2019 05:00:09 +0000</pubDate>
				<category><![CDATA[Security]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[cli]]></category>
		<category><![CDATA[go]]></category>
		<category><![CDATA[gotop]]></category>
		<category><![CDATA[How to]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[htop]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[monitoring]]></category>
		<category><![CDATA[terminal]]></category>
		<category><![CDATA[top]]></category>
		<category><![CDATA[Tutorial]]></category>
		<guid isPermaLink="false">https://www.osradar.com/?p=10489</guid>

					<description><![CDATA[<p>It is always a good idea to know various tools for monitoring systems from the terminal. Of course, they can not be compared to professional tools like Zabbix, but neither do many users really need them. We&#8217;ve already talked about Hegemon. Now it is Gotop&#8217;s turn. Using Gotop you can see the resources spent by [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://www.osradar.com/using-gotop-a-graphical-system-monitor/">Using Gotop a graphical system monitor</a> appeared first on <a rel="nofollow" href="https://www.osradar.com">Linux  Windows and android  Tutorials</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>It is always a good idea to know various tools for monitoring systems from the terminal. Of course, they can not be compared to professional tools like Zabbix, but neither do many users really need them. We&#8217;ve already talked about Hegemon. Now it is Gotop&#8217;s turn. Using Gotop you can see the resources spent by the system in a very friendly way.</p>
<p><a href="https://github.com/cjbassi/gotop" rel="noopener">Gotop is another terminal based graphical</a> activity monitor, inspired by gtop and vtop, this time written in Go. With this tool, you can visualize the resources that your system consumes in a very friendly way. It is written in <a href="https://www.osradar.com/install-go-language-ubuntu-18-04/" rel="noopener">Go</a> with many advantages in execution time. It is quite fast and does not consume almost resources.</p>
<p>Some of its main features are:</p>
<ul>
<li>It is available for all Linux distributions. As well as for Mac OS and BSD.</li>
<li>You can customize the color scheme of the application adapting it to your needs.</li>
<li>It is open source. The program is released under the <a href="https://github.com/cjbassi/gotop/blob/master/LICENSE" rel="noopener">GNU Affero General Public License</a>.</li>
<li>You can monitor CPU, Network, RAM, battery level and processes.</li>
</ul>
<p>And many more.</p>
<p>So, let using Gotop.</p>
<h2>1. Upgrade the system</h2>
<p>The first step is to update the system so that it has the best possible performance and you will be able to show more accurate data when running Gotop.</p>
<p>So, in <a href="https://www.osradar.com/set-up-dhcp-server-debian-9/" rel="noopener">Debian</a>, <a href="https://www.osradar.com/install-apachemq-ubuntu-18-04/" rel="noopener">Ubuntu</a>, and derivates:</p>
<pre class="">:~$ sudo apt update &amp;&amp; sudo apt upgrade</pre>
<p><figure id="attachment_10490" aria-describedby="caption-attachment-10490" style="width: 991px" class="wp-caption alignnone"><img loading="lazy" class="size-full wp-image-10490" src="https://www.osradar.com/wp-content/uploads/2019/02/1-1.png" alt="1.- Upgrade the system" width="991" height="363" srcset="https://www.osradar.com/wp-content/uploads/2019/02/1-1.png 991w, https://www.osradar.com/wp-content/uploads/2019/02/1-1-300x110.png 300w, https://www.osradar.com/wp-content/uploads/2019/02/1-1-768x281.png 768w, https://www.osradar.com/wp-content/uploads/2019/02/1-1-696x255.png 696w" sizes="(max-width: 991px) 100vw, 991px" /><figcaption id="caption-attachment-10490" class="wp-caption-text">1.- Upgrade the system</figcaption></figure></p>
<p>&nbsp;</p>
<p>For <a href="https://www.osradar.com/how-to-install-zabbix-server-4-on-centos-7/" rel="noopener">CentOS</a> 7 and RHEL:</p>
<pre class="">:~$ sudo yum update</pre>
<p>If you are using <a href="https://osradar.com/tag/fedora/" rel="noopener">Fedora</a> 28, 29:</p>
<pre class="">:~$ sudo dnf update</pre>
<p>Finally, if you are using OpenSUSE, you can update the system with this command:</p>
<pre class="">:~$ sudo zypper up</pre>
<p>Once you have updated the system, you can move on.</p>
<h2>2. Installing and using Gotop</h2>
<p>Now it is time for installation. To do this, first, you have to download the binaries from the <a href="https://github.com/cjbassi/gotop/releases" rel="noopener">download section</a> of the project website.</p>
<p>At the time of writing this post, the latest stable version of Gotop is 2.0 which introduces new features such as the ability to monitor the battery of a laptop.</p>
<p>So, download it.</p>
<pre class="">:~$ wget -c https://github.com/cjbassi/gotop/releases/download/2.0.0/gotop_2.0.0_linux_amd64.tgz</pre>
<p><figure id="attachment_10491" aria-describedby="caption-attachment-10491" style="width: 1365px" class="wp-caption alignnone"><img loading="lazy" class="size-full wp-image-10491" src="https://www.osradar.com/wp-content/uploads/2019/02/2-1.png" alt="2.- Download Gotop" width="1365" height="504" srcset="https://www.osradar.com/wp-content/uploads/2019/02/2-1.png 1365w, https://www.osradar.com/wp-content/uploads/2019/02/2-1-300x111.png 300w, https://www.osradar.com/wp-content/uploads/2019/02/2-1-768x284.png 768w, https://www.osradar.com/wp-content/uploads/2019/02/2-1-1024x378.png 1024w, https://www.osradar.com/wp-content/uploads/2019/02/2-1-696x257.png 696w, https://www.osradar.com/wp-content/uploads/2019/02/2-1-1068x394.png 1068w, https://www.osradar.com/wp-content/uploads/2019/02/2-1-1138x420.png 1138w" sizes="(max-width: 1365px) 100vw, 1365px" /><figcaption id="caption-attachment-10491" class="wp-caption-text">2.- Download Gotop</figcaption></figure></p>
<p>Of course, if you do not have wget installed, you have to do it.</p>
<p>For Debian, Ubuntu, Linux Mint and derivates:</p>
<pre class="">:~$ sudo apt install wget</pre>
<p>In case, you are using CentOS 7 and RHEL:</p>
<pre class="">:~$ yum install wget</pre>
<p>For Fedora 29:</p>
<pre class="">:~$ sudo dnf install wget</pre>
<p>Finally, if you are using OpenSUSE:</p>
<pre class="">:~$ sudo zypper in wget</pre>
<p>However, wget is a main component of the system. It is likely installed by default.</p>
<p>Next, decompress the file.</p>
<pre class="">:~$ tar -xvzf gotop_2.0.0_linux_amd64.tgz</pre>
<p><figure id="attachment_10492" aria-describedby="caption-attachment-10492" style="width: 826px" class="wp-caption alignnone"><img loading="lazy" class="size-full wp-image-10492" src="https://www.osradar.com/wp-content/uploads/2019/02/3-1.png" alt="3.- Decompress the file" width="826" height="141" srcset="https://www.osradar.com/wp-content/uploads/2019/02/3-1.png 826w, https://www.osradar.com/wp-content/uploads/2019/02/3-1-300x51.png 300w, https://www.osradar.com/wp-content/uploads/2019/02/3-1-768x131.png 768w, https://www.osradar.com/wp-content/uploads/2019/02/3-1-696x119.png 696w" sizes="(max-width: 826px) 100vw, 826px" /><figcaption id="caption-attachment-10492" class="wp-caption-text">3.- Decompress the file</figcaption></figure></p>
<p>Now, run it.</p>
<pre class="">:~$ ./gotop</pre>
<p><figure id="attachment_10494" aria-describedby="caption-attachment-10494" style="width: 1366px" class="wp-caption alignnone"><img loading="lazy" class="size-full wp-image-10494" src="https://www.osradar.com/wp-content/uploads/2019/02/5-1.png" alt="5.- Using Gotop" width="1366" height="768" srcset="https://www.osradar.com/wp-content/uploads/2019/02/5-1.png 1366w, https://www.osradar.com/wp-content/uploads/2019/02/5-1-300x169.png 300w, https://www.osradar.com/wp-content/uploads/2019/02/5-1-768x432.png 768w, https://www.osradar.com/wp-content/uploads/2019/02/5-1-1024x576.png 1024w, https://www.osradar.com/wp-content/uploads/2019/02/5-1-696x391.png 696w, https://www.osradar.com/wp-content/uploads/2019/02/5-1-1068x600.png 1068w, https://www.osradar.com/wp-content/uploads/2019/02/5-1-747x420.png 747w" sizes="(max-width: 1366px) 100vw, 1366px" /><figcaption id="caption-attachment-10494" class="wp-caption-text">5.- Using Gotop</figcaption></figure></p>
<p>To exit, press CTRL + C.</p>
<p>If you want more options, you can show the help.</p>
<pre class="">:~$ ./gotop --help</pre>
<p><figure id="attachment_10496" aria-describedby="caption-attachment-10496" style="width: 764px" class="wp-caption alignnone"><img loading="lazy" class="size-full wp-image-10496" src="https://www.osradar.com/wp-content/uploads/2019/02/6-1.png" alt="6.- Gotop help" width="764" height="368" srcset="https://www.osradar.com/wp-content/uploads/2019/02/6-1.png 764w, https://www.osradar.com/wp-content/uploads/2019/02/6-1-300x145.png 300w, https://www.osradar.com/wp-content/uploads/2019/02/6-1-696x335.png 696w" sizes="(max-width: 764px) 100vw, 764px" /><figcaption id="caption-attachment-10496" class="wp-caption-text">6.- Gotop help</figcaption></figure></p>
<p>So, you can change the color schemes. For example:</p>
<pre class="">:~$ ./gotop --color=monokai</pre>
<p><figure id="attachment_10497" aria-describedby="caption-attachment-10497" style="width: 1366px" class="wp-caption alignnone"><img loading="lazy" class="size-full wp-image-10497" src="https://www.osradar.com/wp-content/uploads/2019/02/7-1.png" alt="7.- Gotop with another color scheme" width="1366" height="768" srcset="https://www.osradar.com/wp-content/uploads/2019/02/7-1.png 1366w, https://www.osradar.com/wp-content/uploads/2019/02/7-1-300x169.png 300w, https://www.osradar.com/wp-content/uploads/2019/02/7-1-768x432.png 768w, https://www.osradar.com/wp-content/uploads/2019/02/7-1-1024x576.png 1024w, https://www.osradar.com/wp-content/uploads/2019/02/7-1-696x391.png 696w, https://www.osradar.com/wp-content/uploads/2019/02/7-1-1068x600.png 1068w, https://www.osradar.com/wp-content/uploads/2019/02/7-1-747x420.png 747w" sizes="(max-width: 1366px) 100vw, 1366px" /><figcaption id="caption-attachment-10497" class="wp-caption-text">7.- Gotop with another color scheme</figcaption></figure></p>
<p>Or, enable the averages.</p>
<pre class="">:~$ ./gotop -a</pre>
<p><figure id="attachment_10498" aria-describedby="caption-attachment-10498" style="width: 1366px" class="wp-caption alignnone"><img loading="lazy" class="size-full wp-image-10498" src="https://www.osradar.com/wp-content/uploads/2019/02/8-1.png" alt="8.- Show the average use of cpu" width="1366" height="768" srcset="https://www.osradar.com/wp-content/uploads/2019/02/8-1.png 1366w, https://www.osradar.com/wp-content/uploads/2019/02/8-1-300x169.png 300w, https://www.osradar.com/wp-content/uploads/2019/02/8-1-768x432.png 768w, https://www.osradar.com/wp-content/uploads/2019/02/8-1-1024x576.png 1024w, https://www.osradar.com/wp-content/uploads/2019/02/8-1-696x391.png 696w, https://www.osradar.com/wp-content/uploads/2019/02/8-1-1068x600.png 1068w, https://www.osradar.com/wp-content/uploads/2019/02/8-1-747x420.png 747w" sizes="(max-width: 1366px) 100vw, 1366px" /><figcaption id="caption-attachment-10498" class="wp-caption-text">8.- Show the average use of CPU</figcaption></figure></p>
<h2>Conclusion</h2>
<p>It is always good to have tools to monitor the state of our system. Now we have another tool that will help us with the task in a simple and friendly.</p>
<p>The post <a rel="nofollow" href="https://www.osradar.com/using-gotop-a-graphical-system-monitor/">Using Gotop a graphical system monitor</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/using-gotop-a-graphical-system-monitor/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>How to use ZCAT and CAT commands on GNU/LINUX</title>
		<link>https://www.osradar.com/how-to-use-zcat-and-cat-commands-on-gnu-linux/</link>
					<comments>https://www.osradar.com/how-to-use-zcat-and-cat-commands-on-gnu-linux/#comments</comments>
		
		<dc:creator><![CDATA[angeloma]]></dc:creator>
		<pubDate>Tue, 21 Aug 2018 09:41:03 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Unix]]></category>
		<category><![CDATA[cli]]></category>
		<category><![CDATA[Command line]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[unix]]></category>
		<guid isPermaLink="false">https://www.osradar.com/?p=5346</guid>

					<description><![CDATA[<p>Many people find it difficult to use the terminal of a GNU/LINUX distribution, and this makes it difficult for them to learn how to work with it, which is one of the most powerful tools in the Unix environment. There are very simple commands to use and others not so simple, for now we will [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://www.osradar.com/how-to-use-zcat-and-cat-commands-on-gnu-linux/">How to use ZCAT and CAT commands on GNU/LINUX</a> appeared first on <a rel="nofollow" href="https://www.osradar.com">Linux  Windows and android  Tutorials</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>Many people find it difficult to use the terminal of a GNU/LINUX distribution, and this makes it difficult for them to learn how to work with it, which is one of the most powerful tools in the Unix environment.</p>
<p>There are very simple commands to use and others not so simple, for now we will focus on two very simple but useful commands when performing tasks in the terminal, especially if you are a system administrator, the ZCAT and CAT commands.</p>
<h2>First we go with zcat!!</h2>
<p>Actually both commands are simple and similar to use, first we will deal with zcat.</p>
<p><strong>zcat</strong> is a command for unix systems such as GNU/LINUX that allows us to view the contents of compressed files from the command line.</p>
<p>Its use from the terminal is simple and uses this syntax:</p>
<p><strong>zcat [OPTION]&#8230; [FILE]&#8230;</strong></p>
<p>Using the help of zcat in the terminal we visualize the available options:</p>
<table style="height: 262px;" width="591">
<tbody>
<tr>
<th colspan="2">ZCAT  options</th>
</tr>
</tbody>
<tbody>
<tr>
<td>Option</td>
<td>Use</td>
</tr>
<tr>
<td>-f &#8211;force</td>
<td>force</td>
</tr>
<tr>
<td>-l, &#8211;list</td>
<td>list compressed file contens</td>
</tr>
<tr>
<td>-q, &#8211;quiet</td>
<td>Suppress all warnings</td>
</tr>
<tr>
<td>-r, &#8211;recursive</td>
<td>recursive mode</td>
</tr>
<tr>
<td>-S, &#8211;suffix=SUF</td>
<td>use suffix SUF on compressed file (replace SUF)</td>
</tr>
<tr>
<td>-t, &#8211;test</td>
<td>test compressed file integrity</td>
</tr>
<tr>
<td>-v, &#8211;verbose</td>
<td>verbose mode</td>
</tr>
</tbody>
</table>
<p>&nbsp;</p>
<p>Its use is simple. First we will create 4.txt files and then we will compress them for our example.</p>
<pre class="">:~$ mkdir zcat_command
:~$ cd zcat_command
:~$ touch r{1..3}.txt
:~$ nano r1.txt // we add some text
:~$ gzip r1.txt r2.txt r3.txt</pre>
<p><figure id="attachment_5364" aria-describedby="caption-attachment-5364" style="width: 1368px" class="wp-caption alignnone"><img loading="lazy" class="size-full wp-image-5364" src="https://www.osradar.com/wp-content/uploads/2018/08/1-5.png" alt="1.- Creating files" width="1368" height="710" srcset="https://www.osradar.com/wp-content/uploads/2018/08/1-5.png 1368w, https://www.osradar.com/wp-content/uploads/2018/08/1-5-300x156.png 300w, https://www.osradar.com/wp-content/uploads/2018/08/1-5-768x399.png 768w, https://www.osradar.com/wp-content/uploads/2018/08/1-5-1024x531.png 1024w, https://www.osradar.com/wp-content/uploads/2018/08/1-5-696x361.png 696w, https://www.osradar.com/wp-content/uploads/2018/08/1-5-1068x554.png 1068w, https://www.osradar.com/wp-content/uploads/2018/08/1-5-809x420.png 809w" sizes="(max-width: 1368px) 100vw, 1368px" /><figcaption id="caption-attachment-5364" class="wp-caption-text">1.- Creating files</figcaption></figure></p>
<p>the result of this is the creation of 3 compressed text files with extension.txt.gz</p>
<p><figure id="attachment_5365" aria-describedby="caption-attachment-5365" style="width: 1368px" class="wp-caption alignnone"><img loading="lazy" class="size-full wp-image-5365" src="https://www.osradar.com/wp-content/uploads/2018/08/2-6.png" alt="2.- showing created files" width="1368" height="710" srcset="https://www.osradar.com/wp-content/uploads/2018/08/2-6.png 1368w, https://www.osradar.com/wp-content/uploads/2018/08/2-6-300x156.png 300w, https://www.osradar.com/wp-content/uploads/2018/08/2-6-768x399.png 768w, https://www.osradar.com/wp-content/uploads/2018/08/2-6-1024x531.png 1024w, https://www.osradar.com/wp-content/uploads/2018/08/2-6-696x361.png 696w, https://www.osradar.com/wp-content/uploads/2018/08/2-6-1068x554.png 1068w, https://www.osradar.com/wp-content/uploads/2018/08/2-6-809x420.png 809w" sizes="(max-width: 1368px) 100vw, 1368px" /><figcaption id="caption-attachment-5365" class="wp-caption-text">2.- showing created files</figcaption></figure></p>
<p>Now we&#8217;re ready to go.</p>
<ul>
<li>
<h4>Display the contents of a compressed text file with gz</h4>
</li>
</ul>
<pre class="">:~$ zcat r1.txt.gz</pre>
<p><figure id="attachment_5366" aria-describedby="caption-attachment-5366" style="width: 1368px" class="wp-caption alignnone"><img loading="lazy" class="size-full wp-image-5366" src="https://www.osradar.com/wp-content/uploads/2018/08/3-6.png" alt="3.- showing the content of a compressed tex file" width="1368" height="710" srcset="https://www.osradar.com/wp-content/uploads/2018/08/3-6.png 1368w, https://www.osradar.com/wp-content/uploads/2018/08/3-6-300x156.png 300w, https://www.osradar.com/wp-content/uploads/2018/08/3-6-768x399.png 768w, https://www.osradar.com/wp-content/uploads/2018/08/3-6-1024x531.png 1024w, https://www.osradar.com/wp-content/uploads/2018/08/3-6-696x361.png 696w, https://www.osradar.com/wp-content/uploads/2018/08/3-6-1068x554.png 1068w, https://www.osradar.com/wp-content/uploads/2018/08/3-6-809x420.png 809w" sizes="(max-width: 1368px) 100vw, 1368px" /><figcaption id="caption-attachment-5366" class="wp-caption-text">3.- showing the content of a compressed tex file</figcaption></figure></p>
<ul>
<li>
<h4>Displaying the contents of multiple files at the same time</h4>
</li>
</ul>
<p>We can display the contents of several files at once:</p>
<pre class="">:~$ zcat file1 file2
:~$ zcat r1.txt.gz r2.txt.gz</pre>
<p>We will get the contents of each file successively:</p>
<p><figure id="attachment_5368" aria-describedby="caption-attachment-5368" style="width: 1368px" class="wp-caption alignnone"><img loading="lazy" class="size-full wp-image-5368" src="https://www.osradar.com/wp-content/uploads/2018/08/4-5.png" alt="4.- Showing multiple contents files" width="1368" height="710" srcset="https://www.osradar.com/wp-content/uploads/2018/08/4-5.png 1368w, https://www.osradar.com/wp-content/uploads/2018/08/4-5-300x156.png 300w, https://www.osradar.com/wp-content/uploads/2018/08/4-5-768x399.png 768w, https://www.osradar.com/wp-content/uploads/2018/08/4-5-1024x531.png 1024w, https://www.osradar.com/wp-content/uploads/2018/08/4-5-696x361.png 696w, https://www.osradar.com/wp-content/uploads/2018/08/4-5-1068x554.png 1068w, https://www.osradar.com/wp-content/uploads/2018/08/4-5-809x420.png 809w" sizes="(max-width: 1368px) 100vw, 1368px" /><figcaption id="caption-attachment-5368" class="wp-caption-text">4.- Showing multiple contents files</figcaption></figure></p>
<ul>
<li>
<h4>Enabling pagination</h4>
</li>
</ul>
<p>To enable pagination we can do it with less or more</p>
<pre class="">:~$ zcat file | more
:~$ zcat file | less
:~$ zcat r1.txt.gz | more
:~$ zcat r1.txt.gz | less</pre>
<p><figure id="attachment_5369" aria-describedby="caption-attachment-5369" style="width: 1368px" class="wp-caption alignnone"><img loading="lazy" class="size-full wp-image-5369" src="https://www.osradar.com/wp-content/uploads/2018/08/5-6.png" alt="5.- enabling pagination" width="1368" height="710" srcset="https://www.osradar.com/wp-content/uploads/2018/08/5-6.png 1368w, https://www.osradar.com/wp-content/uploads/2018/08/5-6-300x156.png 300w, https://www.osradar.com/wp-content/uploads/2018/08/5-6-768x399.png 768w, https://www.osradar.com/wp-content/uploads/2018/08/5-6-1024x531.png 1024w, https://www.osradar.com/wp-content/uploads/2018/08/5-6-696x361.png 696w, https://www.osradar.com/wp-content/uploads/2018/08/5-6-1068x554.png 1068w, https://www.osradar.com/wp-content/uploads/2018/08/5-6-809x420.png 809w" sizes="(max-width: 1368px) 100vw, 1368px" /><figcaption id="caption-attachment-5369" class="wp-caption-text">5.- enabling pagination</figcaption></figure></p>
<ul>
<li>
<h4>Force Mode</h4>
</li>
</ul>
<p>By default zcat only works with.gz compressed files but it can be used with uncompressed files by forcing them to run.</p>
<pre class="">:~$ zcat -f file
:~$ nano t1.txt // add hello
:~$ zcat -f t1.txt</pre>
<p><figure id="attachment_5370" aria-describedby="caption-attachment-5370" style="width: 1368px" class="wp-caption alignnone"><img loading="lazy" class="size-full wp-image-5370" src="https://www.osradar.com/wp-content/uploads/2018/08/6-5.png" alt="6.- Force mode of zcat" width="1368" height="710" srcset="https://www.osradar.com/wp-content/uploads/2018/08/6-5.png 1368w, https://www.osradar.com/wp-content/uploads/2018/08/6-5-300x156.png 300w, https://www.osradar.com/wp-content/uploads/2018/08/6-5-768x399.png 768w, https://www.osradar.com/wp-content/uploads/2018/08/6-5-1024x531.png 1024w, https://www.osradar.com/wp-content/uploads/2018/08/6-5-696x361.png 696w, https://www.osradar.com/wp-content/uploads/2018/08/6-5-1068x554.png 1068w, https://www.osradar.com/wp-content/uploads/2018/08/6-5-809x420.png 809w" sizes="(max-width: 1368px) 100vw, 1368px" /><figcaption id="caption-attachment-5370" class="wp-caption-text">6.- Force mode of zcat</figcaption></figure></p>
<ul>
<li>
<h4>Showing compressed file properties</h4>
</li>
</ul>
<p>It is also possible to show the properties of a file by using the option -l</p>
<pre class="">:~$ zcat -l file.gz
:~$ zcat -l r1.txt.gz</pre>
<p><figure id="attachment_5371" aria-describedby="caption-attachment-5371" style="width: 1368px" class="wp-caption alignnone"><img loading="lazy" class="size-full wp-image-5371" src="https://www.osradar.com/wp-content/uploads/2018/08/7-6.png" alt="7.- Using -l option" width="1368" height="710" srcset="https://www.osradar.com/wp-content/uploads/2018/08/7-6.png 1368w, https://www.osradar.com/wp-content/uploads/2018/08/7-6-300x156.png 300w, https://www.osradar.com/wp-content/uploads/2018/08/7-6-768x399.png 768w, https://www.osradar.com/wp-content/uploads/2018/08/7-6-1024x531.png 1024w, https://www.osradar.com/wp-content/uploads/2018/08/7-6-696x361.png 696w, https://www.osradar.com/wp-content/uploads/2018/08/7-6-1068x554.png 1068w, https://www.osradar.com/wp-content/uploads/2018/08/7-6-809x420.png 809w" sizes="(max-width: 1368px) 100vw, 1368px" /><figcaption id="caption-attachment-5371" class="wp-caption-text">7.- Using -l option</figcaption></figure></p>
<h2>Now it&#8217;s cat&#8217;s turn</h2>
<p>The cat command is very similar in its use and functionality to zcat, but this time we will work with uncompressed text files. But it also serves to concatenate the output of several files by the standard output of the terminal. We will also have a new feature, which is that cat allows us to concatenate text files to be displayed in a single output by the terminal.</p>
<p>First we&#8217;ll examine the help the command gives us from your terminal:</p>
<table style="height: 262px;" width="591">
<tbody>
<tr>
<th colspan="2">CAT options</th>
</tr>
</tbody>
<tbody>
<tr>
<td>Option</td>
<td>Use</td>
</tr>
<tr>
<td>-A, &#8211;show-all</td>
<td>Show all contens</td>
</tr>
<tr>
<td>-b, &#8211;number-nonblank</td>
<td>number nonempty output lines</td>
</tr>
<tr>
<td>-E, &#8211;show-ends</td>
<td>display $ at end of each line</td>
</tr>
<tr>
<td>-n, &#8211;number</td>
<td>number all output lines</td>
</tr>
<tr>
<td>-T, &#8211;show-tabs</td>
<td>display TAB characters as ^I</td>
</tr>
<tr>
<td>-t, &#8211;test</td>
<td>test compressed file integrity</td>
</tr>
<tr>
<td>&#8211;version</td>
<td>show cat&#8217;s version</td>
</tr>
</tbody>
</table>
<p>&nbsp;</p>
<p>We will examine several examples to demonstrate how to use this command:</p>
<ul>
<li>
<h4>Display the contents of a text file</h4>
</li>
</ul>
<p>This is the most basic way to use the cat command:</p>
<pre class="">:~$ cat path_of_the_file
:~$ cat file1</pre>
<p><figure id="attachment_5390" aria-describedby="caption-attachment-5390" style="width: 1368px" class="wp-caption alignnone"><img loading="lazy" class="size-full wp-image-5390" src="https://www.osradar.com/wp-content/uploads/2018/08/8-4.png" alt="8.- Using cat command" width="1368" height="710" srcset="https://www.osradar.com/wp-content/uploads/2018/08/8-4.png 1368w, https://www.osradar.com/wp-content/uploads/2018/08/8-4-300x156.png 300w, https://www.osradar.com/wp-content/uploads/2018/08/8-4-768x399.png 768w, https://www.osradar.com/wp-content/uploads/2018/08/8-4-1024x531.png 1024w, https://www.osradar.com/wp-content/uploads/2018/08/8-4-696x361.png 696w, https://www.osradar.com/wp-content/uploads/2018/08/8-4-1068x554.png 1068w, https://www.osradar.com/wp-content/uploads/2018/08/8-4-809x420.png 809w" sizes="(max-width: 1368px) 100vw, 1368px" /><figcaption id="caption-attachment-5390" class="wp-caption-text">8.- Using cat command</figcaption></figure></p>
<ul>
<li>
<h4>Display the contents of multiple files</h4>
</li>
</ul>
<p>It is also possible to display several files at once, for this purpose:</p>
<pre class="">:~$ cat path_of_the_file1 path_of_the_file2 ...
:~$ cat file1.txt file2.txt</pre>
<p><figure id="attachment_5391" aria-describedby="caption-attachment-5391" style="width: 1368px" class="wp-caption alignnone"><img loading="lazy" class="size-full wp-image-5391" src="https://www.osradar.com/wp-content/uploads/2018/08/9-6.png" alt="9.- using cat command" width="1368" height="710" srcset="https://www.osradar.com/wp-content/uploads/2018/08/9-6.png 1368w, https://www.osradar.com/wp-content/uploads/2018/08/9-6-300x156.png 300w, https://www.osradar.com/wp-content/uploads/2018/08/9-6-768x399.png 768w, https://www.osradar.com/wp-content/uploads/2018/08/9-6-1024x531.png 1024w, https://www.osradar.com/wp-content/uploads/2018/08/9-6-696x361.png 696w, https://www.osradar.com/wp-content/uploads/2018/08/9-6-1068x554.png 1068w, https://www.osradar.com/wp-content/uploads/2018/08/9-6-809x420.png 809w" sizes="(max-width: 1368px) 100vw, 1368px" /><figcaption id="caption-attachment-5391" class="wp-caption-text">9.- using cat command</figcaption></figure></p>
<ul>
<li>
<h4>Identify Specific File Content</h4>
</li>
</ul>
<p>If, as in the previous example, we need to show the contents of several files, it is very useful to identify when one line is finished and the other starts. Using the -e option we can do that, because at the end of the line&#8217;s content display it places the <strong>$ sign</strong></p>
<pre class="">:~$ cat -e file1.txt file2.txt</pre>
<p><figure id="attachment_5392" aria-describedby="caption-attachment-5392" style="width: 1368px" class="wp-caption alignnone"><img loading="lazy" class="size-full wp-image-5392" src="https://www.osradar.com/wp-content/uploads/2018/08/10-4.png" alt="10.- using -e option" width="1368" height="710" srcset="https://www.osradar.com/wp-content/uploads/2018/08/10-4.png 1368w, https://www.osradar.com/wp-content/uploads/2018/08/10-4-300x156.png 300w, https://www.osradar.com/wp-content/uploads/2018/08/10-4-768x399.png 768w, https://www.osradar.com/wp-content/uploads/2018/08/10-4-1024x531.png 1024w, https://www.osradar.com/wp-content/uploads/2018/08/10-4-696x361.png 696w, https://www.osradar.com/wp-content/uploads/2018/08/10-4-1068x554.png 1068w, https://www.osradar.com/wp-content/uploads/2018/08/10-4-809x420.png 809w" sizes="(max-width: 1368px) 100vw, 1368px" /><figcaption id="caption-attachment-5392" class="wp-caption-text">10.- using -e option</figcaption></figure></p>
<ul>
<li>
<h4>Add Number of Lines in Output</h4>
</li>
</ul>
<p>However, showing the lines that a file has is very easy and its use is highly recommended to better examine the file.</p>
<pre class="">:~$ cat -n file1.txt</pre>
<p><figure id="attachment_5393" aria-describedby="caption-attachment-5393" style="width: 1368px" class="wp-caption alignnone"><img loading="lazy" class="size-full wp-image-5393" src="https://www.osradar.com/wp-content/uploads/2018/08/11-3.png" alt="11.- Adding the -n option" width="1368" height="710" srcset="https://www.osradar.com/wp-content/uploads/2018/08/11-3.png 1368w, https://www.osradar.com/wp-content/uploads/2018/08/11-3-300x156.png 300w, https://www.osradar.com/wp-content/uploads/2018/08/11-3-768x399.png 768w, https://www.osradar.com/wp-content/uploads/2018/08/11-3-1024x531.png 1024w, https://www.osradar.com/wp-content/uploads/2018/08/11-3-696x361.png 696w, https://www.osradar.com/wp-content/uploads/2018/08/11-3-1068x554.png 1068w, https://www.osradar.com/wp-content/uploads/2018/08/11-3-809x420.png 809w" sizes="(max-width: 1368px) 100vw, 1368px" /><figcaption id="caption-attachment-5393" class="wp-caption-text">11.- Adding the -n option</figcaption></figure></p>
<ul>
<li>
<h4>Copy Contents of One file to Another</h4>
</li>
</ul>
<p>cat comes from &#8220;concatenate&#8221; so we can pass the content from one file to another.</p>
<pre class="">:~$ cat file1.txt &gt; file2.txt
:~$ cat file2.txt</pre>
<p><figure id="attachment_5394" aria-describedby="caption-attachment-5394" style="width: 1368px" class="wp-caption alignnone"><img loading="lazy" class="size-full wp-image-5394" src="https://www.osradar.com/wp-content/uploads/2018/08/12-4.png" alt="12.- using cat command for copy contents" width="1368" height="710" srcset="https://www.osradar.com/wp-content/uploads/2018/08/12-4.png 1368w, https://www.osradar.com/wp-content/uploads/2018/08/12-4-300x156.png 300w, https://www.osradar.com/wp-content/uploads/2018/08/12-4-768x399.png 768w, https://www.osradar.com/wp-content/uploads/2018/08/12-4-1024x531.png 1024w, https://www.osradar.com/wp-content/uploads/2018/08/12-4-696x361.png 696w, https://www.osradar.com/wp-content/uploads/2018/08/12-4-1068x554.png 1068w, https://www.osradar.com/wp-content/uploads/2018/08/12-4-809x420.png 809w" sizes="(max-width: 1368px) 100vw, 1368px" /><figcaption id="caption-attachment-5394" class="wp-caption-text">12.- using cat command for copy contents</figcaption></figure></p>
<p>With this &gt; cat operator, it reads the contents of the first file and overwrites the second file.</p>
<ul>
<li>
<h4>Combine or Append the Content of One File to Another</h4>
</li>
</ul>
<p>Now if we want to &#8220;combine&#8221; the contents of one file with another we must use the &gt;&gt; operator.</p>
<pre class="">:~$ cat file1.txt &gt;&gt; file2.txt
:~$ cat file2.txt</pre>
<p><figure id="attachment_5395" aria-describedby="caption-attachment-5395" style="width: 1368px" class="wp-caption alignnone"><img loading="lazy" class="size-full wp-image-5395" src="https://www.osradar.com/wp-content/uploads/2018/08/13-2.png" alt="13.- using &gt;&gt; operator" width="1368" height="710" srcset="https://www.osradar.com/wp-content/uploads/2018/08/13-2.png 1368w, https://www.osradar.com/wp-content/uploads/2018/08/13-2-300x156.png 300w, https://www.osradar.com/wp-content/uploads/2018/08/13-2-768x399.png 768w, https://www.osradar.com/wp-content/uploads/2018/08/13-2-1024x531.png 1024w, https://www.osradar.com/wp-content/uploads/2018/08/13-2-696x361.png 696w, https://www.osradar.com/wp-content/uploads/2018/08/13-2-1068x554.png 1068w, https://www.osradar.com/wp-content/uploads/2018/08/13-2-809x420.png 809w" sizes="(max-width: 1368px) 100vw, 1368px" /><figcaption id="caption-attachment-5395" class="wp-caption-text">13.- using &gt;&gt; operator</figcaption></figure></p>
<p>As you can see cat reads the content of the first file and combines it with the second one.</p>
<p>As a result, we can say that these very similar commands in their use are of great help to get a taste for the terminal of any Unix system, or in this case, of GNU/LINUX. Both are simple to use, and their usefulness is very diverse according to what we need.</p>
<p>Try using these and other commands, please share this article through your social networks.</p>
<p>The post <a rel="nofollow" href="https://www.osradar.com/how-to-use-zcat-and-cat-commands-on-gnu-linux/">How to use ZCAT and CAT commands on GNU/LINUX</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-zcat-and-cat-commands-on-gnu-linux/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
	</channel>
</rss>
