<?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>command Archives - Linux Windows and android Tutorials</title>
	<atom:link href="https://www.osradar.com/tag/command/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.osradar.com</link>
	<description>tutorials and news and Seurity</description>
	<lastBuildDate>Wed, 28 Jun 2023 05:25:10 +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>Command Line Magic: Secret Features and Hidden Functions of the Windows Command Prompt</title>
		<link>https://www.osradar.com/command-line-magic-secret-features-and-hidden-functions-of-the-windows-command-prompt/</link>
					<comments>https://www.osradar.com/command-line-magic-secret-features-and-hidden-functions-of-the-windows-command-prompt/#respond</comments>
		
		<dc:creator><![CDATA[roger]]></dc:creator>
		<pubDate>Thu, 06 Jul 2023 17:20:00 +0000</pubDate>
				<category><![CDATA[Windows]]></category>
		<category><![CDATA[cmd]]></category>
		<category><![CDATA[command]]></category>
		<category><![CDATA[command prompt]]></category>
		<guid isPermaLink="false">https://www.osradar.com/?p=39090</guid>

					<description><![CDATA[<p>Many people think that the Command Prompt in the Windows operating system is boring. However, today I bring you a series of curious tricks that will change your mind. In addition, you will learn about functions that you probably did not expect. The Command Prompt is present in Windows 11 and previous versions. Moreover, it [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://www.osradar.com/command-line-magic-secret-features-and-hidden-functions-of-the-windows-command-prompt/">Command Line Magic: Secret Features and Hidden Functions of the Windows Command Prompt</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 think that the Command Prompt in the <a href="https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/windows-commands" target="_blank" rel="noreferrer noopener">Windows </a>operating system is boring. However, today I bring you a series of curious tricks that will change your mind. In addition, you will learn about functions that you probably did not expect. The Command Prompt is present in Windows 11 and previous versions. Moreover, it is one of those parts unknown to many, with too many reminiscences of the past for others. It even seems to be boring and almost useless for a good number of users.</p>



<p>Certainly, it is the last thing we can see within Windows that reminds us of what was MS-DOS. However, what we do have to disagree on is its usefulness. Indeed, the possibilities it offers are almost endless. In fact, it has an enormous scope, something that many people ignore. But not everything stays there. In fact, it can even be fun to use the Command Prompt, or at least a lot more fun than we might imagine. Let&#8217;s take a look at some unexpected, amusing, and even bizarre features hidden in the Command Prompt.</p>



<h2>Customize the appearance</h2>



<p>Although you may find it strange, the command <a href="https://www.osradar.com/12-useful-commands-for-the-command-prompt/" target="_blank" rel="noreferrer noopener">prompt</a> can be customized: You can change the background color, the tab name, search for text and more. To do so, the following must be done:</p>



<ul><li>We enter the <strong>Command Prompt </strong>by typing the same in the search area of the taskbar and clicking <strong>Open</strong> when the option comes up.</li><li><strong>Right-click </strong>on the Command Prompt icon in the upper left corner of the screen.</li><li>We will see how we can select <strong>Color</strong> (to change the color of the Command Prompt), <strong>Rename Tab, Duplicate Tab, Split Table, Export Text</strong> and <strong>Search</strong> (to search for a particular text).</li></ul>



<figure class="wp-block-image size-large"><img loading="lazy" width="1024" height="576" src="https://www.osradar.com/wp-content/uploads/2023/06/cmd-1-1024x576.png" alt="" class="wp-image-39104" srcset="https://www.osradar.com/wp-content/uploads/2023/06/cmd-1-1024x576.png 1024w, https://www.osradar.com/wp-content/uploads/2023/06/cmd-1-300x169.png 300w, https://www.osradar.com/wp-content/uploads/2023/06/cmd-1-768x432.png 768w, https://www.osradar.com/wp-content/uploads/2023/06/cmd-1-696x391.png 696w, https://www.osradar.com/wp-content/uploads/2023/06/cmd-1-1068x601.png 1068w, https://www.osradar.com/wp-content/uploads/2023/06/cmd-1.png 1115w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>



<h2>Window title</h2>



<p>The title of the window can be changed with one command and, moreover, in an extremely simple way. To do it, we must put <em>title</em>. Then, we will write the word or phrase that we want to appear in the header of the <strong>Command Prompt</strong> window. It has a limited utility. However, it is true that it is a curious function. Besides that, few people know about the Windows Command Prompt.</p>



<figure class="wp-block-image size-large"><img loading="lazy" width="1024" height="577" src="https://www.osradar.com/wp-content/uploads/2023/06/cmd2-1024x577.png" alt="" class="wp-image-39105" srcset="https://www.osradar.com/wp-content/uploads/2023/06/cmd2-1024x577.png 1024w, https://www.osradar.com/wp-content/uploads/2023/06/cmd2-300x169.png 300w, https://www.osradar.com/wp-content/uploads/2023/06/cmd2-768x433.png 768w, https://www.osradar.com/wp-content/uploads/2023/06/cmd2-696x392.png 696w, https://www.osradar.com/wp-content/uploads/2023/06/cmd2-1068x602.png 1068w, https://www.osradar.com/wp-content/uploads/2023/06/cmd2.png 1115w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>



<h2>Where your data goes</h2>



<p>This is a fun and interesting trick. Indeed, it can be used for networking and problem-solving. The <em>tracert </em>command, followed by an IP address or a website, will show a list of where our connection bounces to on the way to that address. It is really curious to see all the stops our connection makes on its way to the destination we have marked.</p>



<p>The normal thing is that the configuration of Internet of our house send us to several addresses related to the ISP to later depend on where we are going to go. In fact, each website transfers data differently. This depends on where the website itself connects from and where we are finally going to get to.</p>



<h2>Turning off the computer</h2>



<p>We are also going to be able to turn off the computer thanks to the Command Prompt. This can be useful if there is an incident that does not let Windows do it. Also, if we do not want to force it by means of the physical button of the device.</p>



<p>To shut down the computer, we must put the following command: <em>shutdown/s</em>. If what we want is to restart the computer at that precise moment, what we will have to write is: <em>shutdown/r</em> This way of turning off the computer may not be practical. However, it may come in handy at some point. So it is not a bad thing to have this information.</p>



<p>Imagine that this curious Command Prompt trick is the one that allows you to shut down or restart your computer at a time when you have a problem. Then it won&#8217;t seem so trivial.</p>



<h2>Star Wars</h2>



<p>This is a really different trick that will generate a lot of curious looks when we show it to someone. To view <strong>Star Wars</strong> in the Command Prompt, we must enable a service called <em>Telnet</em>. If you have Windows 10 or 11, press Win + Q, type <em>telnet</em>. Then select <strong>Turn Windows features on or off</strong>.</p>



<p>After that, we go down to the <strong>Telnet Client</strong> entry, check the box, then click OK and close the window.</p>



<figure class="wp-block-image size-full"><img loading="lazy" width="415" height="368" src="https://www.osradar.com/wp-content/uploads/2023/06/cmd3.png" alt="" class="wp-image-39106" srcset="https://www.osradar.com/wp-content/uploads/2023/06/cmd3.png 415w, https://www.osradar.com/wp-content/uploads/2023/06/cmd3-300x266.png 300w" sizes="(max-width: 415px) 100vw, 415px" /></figure>



<p>Re-enter the <strong>Command Prompt</strong> and execute the following commands, pressing Enter after each one:</p>



<ul><li><strong>telnet telehack.com</strong></li><li><strong>starwars</strong></li></ul>



<p>Then you just have to enjoy looking at the screen, since we will have the story of <strong>Star Wars Episode IV</strong> totally made by ASCII. Undoubtedly, something curious, fun and, for many users, even entertaining.</p>



<figure class="wp-block-image size-large"><img loading="lazy" width="1024" height="577" src="https://www.osradar.com/wp-content/uploads/2023/06/cmd4-1024x577.png" alt="" class="wp-image-39107" srcset="https://www.osradar.com/wp-content/uploads/2023/06/cmd4-1024x577.png 1024w, https://www.osradar.com/wp-content/uploads/2023/06/cmd4-300x169.png 300w, https://www.osradar.com/wp-content/uploads/2023/06/cmd4-768x433.png 768w, https://www.osradar.com/wp-content/uploads/2023/06/cmd4-696x392.png 696w, https://www.osradar.com/wp-content/uploads/2023/06/cmd4-1068x602.png 1068w, https://www.osradar.com/wp-content/uploads/2023/06/cmd4.png 1115w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>



<h2>Command Prompt Aquarium</h2>



<p>If we continue using <strong>Telnet</strong> we can not only have Star Wars on the screen, but more possibilities. As soon as we start with the telnet command <strong>telehack.com</strong>, we see that there are many more options, but the one we are going to see next is possibly the best achieved.</p>



<p>The most remarkable thing next to the Star Wars ASCII recreation is the <em>aquarium</em> command. If we put this command as we did in the previous case (instead of putting <strong>starwars)</strong> we will see an ASCII aquarium that could even be used as a screensaver.</p>



<figure class="wp-block-image size-large"><img loading="lazy" width="1024" height="577" src="https://www.osradar.com/wp-content/uploads/2023/06/cmd5-1024x577.png" alt="" class="wp-image-39108" srcset="https://www.osradar.com/wp-content/uploads/2023/06/cmd5-1024x577.png 1024w, https://www.osradar.com/wp-content/uploads/2023/06/cmd5-300x169.png 300w, https://www.osradar.com/wp-content/uploads/2023/06/cmd5-768x433.png 768w, https://www.osradar.com/wp-content/uploads/2023/06/cmd5-696x392.png 696w, https://www.osradar.com/wp-content/uploads/2023/06/cmd5-1068x602.png 1068w, https://www.osradar.com/wp-content/uploads/2023/06/cmd5.png 1115w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>



<p>With all these tricks, you will have witnessed that the Windows Command Prompt has many practical functions for the configuration and management of the operating system. In addition to others that are very curious.</p>



<p>That means that the Windows Command Prompt can surprise you much more than you might expect with these curious tricks. The truth is that fun can be found in the most unlikely places.</p>
<p>The post <a rel="nofollow" href="https://www.osradar.com/command-line-magic-secret-features-and-hidden-functions-of-the-windows-command-prompt/">Command Line Magic: Secret Features and Hidden Functions of the Windows Command Prompt</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/command-line-magic-secret-features-and-hidden-functions-of-the-windows-command-prompt/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>The Linux cat command</title>
		<link>https://www.osradar.com/the-linux-cat-command/</link>
					<comments>https://www.osradar.com/the-linux-cat-command/#respond</comments>
		
		<dc:creator><![CDATA[angeloma]]></dc:creator>
		<pubDate>Sat, 29 Feb 2020 03:43:00 +0000</pubDate>
				<category><![CDATA[Desktop]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Servers]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Unix]]></category>
		<category><![CDATA[cat]]></category>
		<category><![CDATA[command]]></category>
		<category><![CDATA[How to]]></category>
		<category><![CDATA[terminal]]></category>
		<category><![CDATA[Tutorial]]></category>
		<guid isPermaLink="false">https://www.osradar.com/?p=18651</guid>

					<description><![CDATA[<p>Friends today I am going to teach you about the Linux cat command. This command is quite simple to learn but quite useful in many situations. So, today we will teach it to you along with some examples so that you can better understand this command. The cat command is part of GNU CoreUtils and [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://www.osradar.com/the-linux-cat-command/">The Linux cat 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>Friends today I am going to teach you <strong>about the Linux cat command</strong>. This command is quite simple to learn but quite useful in many situations. So, today we will teach it to you along with some examples so that you can better understand this command.</p>



<p>The cat command is part of <a href="https://www.gnu.org/software/coreutils/manual/" target="_blank" rel="noreferrer noopener" aria-label="GNU CoreUtils (opens in a new tab)">GNU CoreUtils</a> and is mainly used to display by standard output the entire contents of a text file. This can be quite useful in many advanced tasks with the system, for example, sysadmin uses it quite a bit to view any file from the terminal.</p>



<p>On the other hand, the cat command is also used to create files because it allows you to capture standard input and assign it to an empty file. Of course, this possibility offered by the cat command is rarely used.</p>



<p>So let&#8217;s go for it.</p>



<h2>The Linux cat command</h2>



<p>Cat is a fairly simple command to use, it is also possible to use it on UNIX based systems such as FreeBSD. It has a basic syntax of use which is as follows:</p>



<pre class="wp-block-preformatted">cat [OPTION]… [FILE]…</pre>



<p>However, it has other options that extend the functionality of the command. If you want to show them, just use the following command:</p>



<pre class="wp-block-preformatted">:~$ cat --help
Usage: cat [OPTION]… [FILE]…
 Concatenate FILE(s) to standard output.
 With no FILE, or when FILE is -, read standard input.
 -A, --show-all           equivalent to -vET
   -b, --number-nonblank    number nonempty output lines, overrides -n
   -e                       equivalent to -vE
   -E, --show-ends          display $ at end of each line
   -n, --number             number all output lines
   -s, --squeeze-blank      suppress repeated empty output lines
   -t                       equivalent to -vT
   -T, --show-tabs          display TAB characters as ^I
   -u                       (ignored)
   -v, --show-nonprinting   use ^ and M- notation, except for LFD and TAB
       --help     display this help and exit
       --version  output version information and exit
 Examples:
   cat f - g  Output f's contents, then standard input, then g's contents.
   cat        Copy standard input to standard output.
 GNU coreutils online help: <a href="http://www.gnu.org/software/coreutils/">http://www.gnu.org/software/coreutils/</a>
 Full documentation at: <a href="http://www.gnu.org/software/coreutils/cat">http://www.gnu.org/software/coreutils/cat</a>
 or available locally via: info '(coreutils) cat invocation'</pre>



<figure class="wp-block-image size-large"><img loading="lazy" width="799" height="471" src="https://www.osradar.com/wp-content/uploads/2020/02/1-21.png" alt="1.- Cat command help" class="wp-image-18652" srcset="https://www.osradar.com/wp-content/uploads/2020/02/1-21.png 799w, https://www.osradar.com/wp-content/uploads/2020/02/1-21-300x177.png 300w, https://www.osradar.com/wp-content/uploads/2020/02/1-21-768x453.png 768w, https://www.osradar.com/wp-content/uploads/2020/02/1-21-696x410.png 696w, https://www.osradar.com/wp-content/uploads/2020/02/1-21-712x420.png 712w" sizes="(max-width: 799px) 100vw, 799px" /><figcaption>1.- Cat command help</figcaption></figure>



<p>But, let&#8217;s see the usefulness of the cat command using several useful examples.</p>



<h2>Using the cat command</h2>



<p>I will create a sample text file called file.txt and add content.</p>



<p>To display the contents of the file, simply use the following command:</p>



<pre class="wp-block-preformatted">:~$ cat file.txt</pre>



<figure class="wp-block-image size-large"><img loading="lazy" width="583" height="215" src="https://www.osradar.com/wp-content/uploads/2020/02/2-20.png" alt="2.- Using the cat command" class="wp-image-18654" srcset="https://www.osradar.com/wp-content/uploads/2020/02/2-20.png 583w, https://www.osradar.com/wp-content/uploads/2020/02/2-20-300x111.png 300w" sizes="(max-width: 583px) 100vw, 583px" /><figcaption>2.- Using the cat command</figcaption></figure>



<p>It is also possible to use an absolute route, for example:</p>



<pre class="wp-block-preformatted">:~$ cat /home/angelo/file.txt</pre>



<p>So you can see the contents of a file from another directory.</p>



<p>It is also possible to view the contents of several files, just separate them by a blank space:</p>



<pre class="wp-block-preformatted">:~$ cat file.txt file2.txt</pre>



<p>And so on.</p>



<p>It is also possible, to show the content of the file and display the lines it has. To do this, add the -n option.</p>



<pre class="wp-block-preformatted">:~$ cat -n file.txt</pre>



<figure class="wp-block-image size-large"><img loading="lazy" width="551" height="273" src="https://www.osradar.com/wp-content/uploads/2020/02/3-17.png" alt="3.- Using the -n option" class="wp-image-18655" srcset="https://www.osradar.com/wp-content/uploads/2020/02/3-17.png 551w, https://www.osradar.com/wp-content/uploads/2020/02/3-17-300x149.png 300w, https://www.osradar.com/wp-content/uploads/2020/02/3-17-324x160.png 324w" sizes="(max-width: 551px) 100vw, 551px" /><figcaption>3.- Using the -n option</figcaption></figure>



<p>So we can quickly identify a particular line. </p>



<p>However, many text files have empty lines. This is common. The cat command also allows us to show only those that have content and are not empty. The -b option is the correct one.</p>



<pre class="wp-block-preformatted">:~$ cat -b file.txt</pre>



<figure class="wp-block-image size-large"><img loading="lazy" width="383" height="211" src="https://www.osradar.com/wp-content/uploads/2020/02/4-17.png" alt="4.- Showing only the relevant lines" class="wp-image-18656" srcset="https://www.osradar.com/wp-content/uploads/2020/02/4-17.png 383w, https://www.osradar.com/wp-content/uploads/2020/02/4-17-300x165.png 300w" sizes="(max-width: 383px) 100vw, 383px" /><figcaption>4.- Showing only the relevant lines</figcaption></figure>



<p>If you want to know when a line ends, the cat command can help you with the -E option.</p>



<pre class="wp-block-preformatted">:~$ cat -E file.txt</pre>



<figure class="wp-block-image size-large"><img loading="lazy" width="493" height="235" src="https://www.osradar.com/wp-content/uploads/2020/02/5-15.png" alt="5.- Cat can show the end of the lines" class="wp-image-18657" srcset="https://www.osradar.com/wp-content/uploads/2020/02/5-15.png 493w, https://www.osradar.com/wp-content/uploads/2020/02/5-15-300x143.png 300w" sizes="(max-width: 493px) 100vw, 493px" /><figcaption>5.- Cat can show the end of the lines</figcaption></figure>



<p>Also, cat can display the non-printable characters with the -v option.</p>



<pre class="wp-block-preformatted">:~$ cat -v file.txt</pre>



<p>Or the tabs with the -T option</p>



<pre class="wp-block-preformatted">:~$ cat -T file.txt</pre>



<figure class="wp-block-image size-large"><img loading="lazy" width="521" height="258" src="https://www.osradar.com/wp-content/uploads/2020/02/6-12.png" alt="6.- Showing the TAB with the cat command" class="wp-image-18659" srcset="https://www.osradar.com/wp-content/uploads/2020/02/6-12.png 521w, https://www.osradar.com/wp-content/uploads/2020/02/6-12-300x149.png 300w, https://www.osradar.com/wp-content/uploads/2020/02/6-12-324x160.png 324w" sizes="(max-width: 521px) 100vw, 521px" /><figcaption>6.- Showing the TAB with the cat command</figcaption></figure>



<p>Note: I have modified the file to include a tab and show you how it looks.</p>



<p>So, that is it. You already know how to use the cat command.</p>



<h2>Conclusion</h2>



<p>The cat command is quite simple to use but it can get us out of trouble in many cases. Especially useful if you are sysadmin or a student of some computer-related engineering, the post will help you get familiar with the terminal.</p>



<p>Please share this post and join our Telegram channel.</p>



<p>I invite you to read other posts about Linux commands:</p>



<p><a href="https://www.osradar.com/copy-file-folder-using-cp-command-in-linux/" target="_blank" rel="noreferrer noopener" aria-label="cp command (opens in a new tab)">cp command</a><br><a href="https://www.osradar.com/the-linux-tail-command/" target="_blank" rel="noreferrer noopener" aria-label="The Tail command  (opens in a new tab)">The Tail command </a><br><a href="https://www.osradar.com/the-linux-head-command/" target="_blank" rel="noreferrer noopener" aria-label="head command  (opens in a new tab)">head command </a><br><a href="https://www.osradar.com/the-wget-command/" target="_blank" rel="noreferrer noopener" aria-label="The wget command  (opens in a new tab)">The wget command </a></p>



<p></p>
<p>The post <a rel="nofollow" href="https://www.osradar.com/the-linux-cat-command/">The Linux cat 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-cat-command/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>The Linux head command</title>
		<link>https://www.osradar.com/the-linux-head-command/</link>
					<comments>https://www.osradar.com/the-linux-head-command/#respond</comments>
		
		<dc:creator><![CDATA[angeloma]]></dc:creator>
		<pubDate>Wed, 26 Feb 2020 23:42:00 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Unix]]></category>
		<category><![CDATA[command]]></category>
		<category><![CDATA[commands]]></category>
		<category><![CDATA[head command]]></category>
		<category><![CDATA[terminal]]></category>
		<guid isPermaLink="false">https://www.osradar.com/?p=18457</guid>

					<description><![CDATA[<p>Hi, folks. We&#8217;re still exploring the terminal and this time we&#8217;re going to focus on the Linux head command. So let&#8217;s go for it. If you&#8217;re new to Linux you probably won&#8217;t like the terminal, and that&#8217;s understandable but I&#8217;m also telling you that it&#8217;s a very powerful tool and it&#8217;s not as complicated as [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://www.osradar.com/the-linux-head-command/">The Linux head 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>Hi, folks. We&#8217;re still exploring the terminal and this time we&#8217;re going to focus on the Linux head command. So let&#8217;s go for it.</p>
<p>If you&#8217;re new to Linux you probably won&#8217;t like the terminal, and that&#8217;s understandable but I&#8217;m also telling you that it&#8217;s a very powerful tool and it&#8217;s not as complicated as it seems. Also, many sysadmin users use it almost every day and this is because it is very efficient.</p>
<p>Yes, it is true, there are more complicated commands to use but in this case, the head command is quite simple.</p>
<h2>Introduction</h2>
<p>The head command is the complement of the <a href="https://www.osradar.com/the-linux-tail-command/" target="_blank" rel="noopener noreferrer">Tail command</a>. It is used to display the first few lines of a text file. Therefore, the use of this command is very useful for sysadmin that needs to check logs constantly.</p>
<p>Like the Tail command, the head command belongs to GNU utils which is a range of tools for processing files and folders by the terminal. So this command is for sure available in your favorite Linux distribution.</p>
<p>Now we will show you how to use it with some simple examples.</p>
<h2>Using the Linux Head command</h2>
<p>The Head command is one of the simplest there is. The basic syntax of the command is as follows:</p>
<pre>~$ head [OPTION]... [FILE]..</pre>
<p>As you can see there are options that alter the behavior of the command. To see all the available options, just use this command:</p>
<pre>:~$ head --help</pre>
<p><figure id="attachment_18475" aria-describedby="caption-attachment-18475" style="width: 812px" class="wp-caption alignnone"><img loading="lazy" class="size-full wp-image-18475" src="https://www.osradar.com/wp-content/uploads/2020/02/1-16.png" alt="1.- The head command" width="812" height="502" srcset="https://www.osradar.com/wp-content/uploads/2020/02/1-16.png 812w, https://www.osradar.com/wp-content/uploads/2020/02/1-16-300x185.png 300w, https://www.osradar.com/wp-content/uploads/2020/02/1-16-768x475.png 768w, https://www.osradar.com/wp-content/uploads/2020/02/1-16-356x220.png 356w, https://www.osradar.com/wp-content/uploads/2020/02/1-16-696x430.png 696w, https://www.osradar.com/wp-content/uploads/2020/02/1-16-679x420.png 679w" sizes="(max-width: 812px) 100vw, 812px" /><figcaption id="caption-attachment-18475" class="wp-caption-text">1.- The head command</figcaption></figure></p>
<p>And as you can see in the image, they are few and this reaffirms what I said about it being a pretty simple command to use.</p>
<p>To better demonstrate the use of the command, I have created a text file called <strong>example.txt</strong> and added certain names.</p>
<p><figure id="attachment_18389" aria-describedby="caption-attachment-18389" style="width: 791px" class="wp-caption alignnone"><img loading="lazy" class="size-full wp-image-18389" src="https://www.osradar.com/wp-content/uploads/2020/02/2-12.png" alt="2.- Example file" width="791" height="297" 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 id="caption-attachment-18389" class="wp-caption-text">2.- Example file</figcaption></figure></p>
<p>option. For example, display the first 3 lines of the file.</p>
<pre>:~$ head -n 3 example.txt</pre>
<p><figure id="attachment_18476" aria-describedby="caption-attachment-18476" style="width: 784px" class="wp-caption alignnone"><img loading="lazy" class="size-full wp-image-18476" src="https://www.osradar.com/wp-content/uploads/2020/02/2-15.png" alt="3.- Using the Linux head command" width="784" height="147" srcset="https://www.osradar.com/wp-content/uploads/2020/02/2-15.png 784w, https://www.osradar.com/wp-content/uploads/2020/02/2-15-300x56.png 300w, https://www.osradar.com/wp-content/uploads/2020/02/2-15-768x144.png 768w, https://www.osradar.com/wp-content/uploads/2020/02/2-15-696x131.png 696w" sizes="(max-width: 784px) 100vw, 784px" /><figcaption id="caption-attachment-18476" class="wp-caption-text">3.- Using the Linux head command</figcaption></figure></p>
<p>We can even use the head command to display a number of bits of the file. This is made possible by the -c option.</p>
<pre>:~$ head -c 10 example.txt</pre>
<p><figure id="attachment_18477" aria-describedby="caption-attachment-18477" style="width: 819px" class="wp-caption alignnone"><img loading="lazy" class="wp-image-18477 size-full" src="https://www.osradar.com/wp-content/uploads/2020/02/3-12.png" alt="4.- Using -c option on the head command" width="819" height="144" srcset="https://www.osradar.com/wp-content/uploads/2020/02/3-12.png 819w, https://www.osradar.com/wp-content/uploads/2020/02/3-12-300x53.png 300w, https://www.osradar.com/wp-content/uploads/2020/02/3-12-768x135.png 768w, https://www.osradar.com/wp-content/uploads/2020/02/3-12-696x122.png 696w" sizes="(max-width: 819px) 100vw, 819px" /><figcaption id="caption-attachment-18477" class="wp-caption-text">4.- Using -c option on the head command</figcaption></figure></p>
<p>Finally, it is possible to use the -v option to display the title of the file. Use it in some cases.</p>
<pre>:~$ head -v example.txt</pre>
<p><figure id="attachment_18478" aria-describedby="caption-attachment-18478" style="width: 643px" class="wp-caption alignnone"><img loading="lazy" class="size-full wp-image-18478" src="https://www.osradar.com/wp-content/uploads/2020/02/4-12.png" alt="5.- Verbose mode" width="643" height="249" srcset="https://www.osradar.com/wp-content/uploads/2020/02/4-12.png 643w, https://www.osradar.com/wp-content/uploads/2020/02/4-12-300x116.png 300w" sizes="(max-width: 643px) 100vw, 643px" /><figcaption id="caption-attachment-18478" class="wp-caption-text">5.- Verbose mode</figcaption></figure></p>
<p>And well, that&#8217;s it. The head command is quite useful and simple to use and using it with the tail command makes an extraordinary combination.</p>
<p>Please, share this post and join our <a href="https://t.me/osradar" target="_blank" rel="noopener noreferrer">Telegram channel</a>.</p>
<p>The post <a rel="nofollow" href="https://www.osradar.com/the-linux-head-command/">The Linux head 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-head-command/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Synchronous data Using rsync Command in Linux</title>
		<link>https://www.osradar.com/synchronous-data-using-rsync-command-in-linux/</link>
					<comments>https://www.osradar.com/synchronous-data-using-rsync-command-in-linux/#respond</comments>
		
		<dc:creator><![CDATA[Mel]]></dc:creator>
		<pubDate>Fri, 11 Oct 2019 20:23:23 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Tools]]></category>
		<category><![CDATA[command]]></category>
		<category><![CDATA[cp]]></category>
		<category><![CDATA[rsync]]></category>
		<category><![CDATA[tools]]></category>
		<guid isPermaLink="false">https://www.osradar.com/?p=14494</guid>

					<description><![CDATA[<p>Introduction Rsync, remote synchronize is known as a remote synchronization function of the software, it synchronizes files at the same time, can maintain the original file permissions, time, hard and soft links and other additional information. it is a &#8220;sync algorithm&#8221; that provides a quick way to synchronize files between clients and remote file servers, [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://www.osradar.com/synchronous-data-using-rsync-command-in-linux/">Synchronous data Using rsync Command in Linux</a> appeared first on <a rel="nofollow" href="https://www.osradar.com">Linux  Windows and android  Tutorials</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<figure class="wp-block-image is-resized"><img loading="lazy" src="//1723336065.rsc.cdn77.org/wp-content/uploads/2019/10/39305640991_17be320f7b_o.jpg" alt="rsync" class="wp-image-14533" width="700" height="366" srcset="https://www.osradar.com/wp-content/uploads/2019/10/39305640991_17be320f7b_o.jpg 640w, https://www.osradar.com/wp-content/uploads/2019/10/39305640991_17be320f7b_o-300x157.jpg 300w" sizes="(max-width: 700px) 100vw, 700px" /></figure>



<h2 id="introduction"><strong>Introduction</strong></h2>



<p>Rsync, remote synchronize is known as a remote synchronization function of the software, it synchronizes files at the same time, can maintain the original file permissions, time, hard and soft links and other additional information. it is a &#8220;sync algorithm&#8221; that provides a quick way to synchronize files between clients and remote file servers, and can also be transferred via SSH, which is also very confidential, supports breakpoint continuation, data can be pushed or pulled, and is free of chargeS.</p>



<p>Rsync advantages：</p>



<ul><li>Ability to update entire directories and trees and file systems;</li><li>Selectively maintain symbolic links, hard links, file ownership, permissions, devices, and   time for folders and files;</li><li>For installation, there are no special permission requirements;</li><li>For multiple files, the internal pipeline reduces the file wait delay;</li><li>Can use RSH, SSH or direct port as the transfer port;</li><li>Support anonymous Rsync synchronization files are the ideal mirror tool;</li></ul>



<h2><strong>Installation</strong></h2>



<p>Installing rsync is pretty easy, it doesn&#8217;t rely on any special libraries at all, so you can install it directly with yum.</p>



<pre class="wp-block-preformatted">yum install -y rsync </pre>



<p>The command rsync will appear once the installation is complete</p>



<h2><strong>Rsync works</strong></h2>



<p>Rsync works in three ways：<br>1.synchronization on the local file system. <br>2.the local host USES the remote shell to communicate with the remote host. <br>3.localhost connects rsync daemon on a remote host via network socket. </p>



<p>Here is the syntax  works for each rsync:</p>



<pre class="wp-block-preformatted">Local:  
      rsync [OPTION...] SRC... [DEST]   
Access via remote shell:   
      Pull: rsync [OPTION...] [USER@]HOST:SRC... [DEST]   
      Push: rsync [OPTION...] SRC... [USER@]HOST:DEST   
Access via rsync daemon:   
      Pull: rsync [OPTION...] [USER@]HOST::SRC... [DEST]         
            rsync [OPTION...] rsync://[USER@]HOST[:PORT]/SRC... [DEST]   
      Push: 
            rsync [OPTION...] SRC... [USER@]HOST::DEST         
            rsync [OPTION...] SRC... rsync://[USER@]HOST[:PORT]/DEST </pre>



<h2><strong>Option</strong></h2>



<pre class="wp-block-preformatted">man rsync</pre>



<pre class="wp-block-preformatted">Options
 -v, --verbose               increase verbosity
 -q, --quiet                 suppress non-error messages
     --no-motd               suppress daemon-mode MOTD (see manpage caveat)
 -c, --checksum              skip based on checksum, not mod-time &amp; size
 -a, --archive               archive mode; equals -rlptgoD (no -H,-A,-X)
     --no-OPTION             turn off an implied OPTION (e.g. --no-D)
 -r, --recursive             recurse into directories
 -R, --relative              use relative path names
     --no-implied-dirs       don't send implied dirs with --relative
 -b, --backup                make backups (see --suffix &amp; --backup-dir)
     --backup-dir=DIR        make backups into hierarchy based in DIR
     --suffix=SUFFIX         set backup suffix (default ~ w/o --backup-dir)
 -u, --update                skip files that are newer on the receiver
     --inplace               update destination files in-place (SEE MAN PAGE)
     --append                append data onto shorter files
     --append-verify         like --append, but with old data in file checksum
 -d, --dirs                  transfer directories without recursing
 -l, --links                 copy symlinks as symlinks
 -L, --copy-links            transform symlink into referent file/dir
     --copy-unsafe-links     only "unsafe" symlinks are transformed
     --safe-links            ignore symlinks that point outside the source tree
 -k, --copy-dirlinks         transform symlink to a dir into referent dir
 -K, --keep-dirlinks         treat symlinked dir on receiver as dir
 -H, --hard-links            preserve hard links
 -p, --perms                 preserve permissions
 -E, --executability         preserve the file's executability
     --chmod=CHMOD           affect file and/or directory permissions
 -A, --acls                  preserve ACLs (implies --perms)
 -X, --xattrs                preserve extended attributes
 -o, --owner                 preserve owner (super-user only)
 -g, --group                 preserve group
     --devices               preserve device files (super-user only)
     --copy-devices          copy device contents as regular file
     --specials              preserve special files
 -D                          same as --devices --specials
 -t, --times                 preserve modification times
 -O, --omit-dir-times        omit directories from --times
     --super                 receiver attempts super-user activities
     --fake-super            store/recover privileged attrs using xattrs
 -S, --sparse                handle sparse files efficiently
 -n, --dry-run               perform a trial run with no changes made
 -W, --whole-file            copy files whole (without delta-xfer algorithm)
 -x, --one-file-system       don't cross filesystem boundaries
 -B, --block-size=SIZE       force a fixed checksum block-size
 -e, --rsh=COMMAND           specify the remote shell to use
     --rsync-path=PROGRAM    specify the rsync to run on the remote machine
     --existing              skip creating new files on receiver
     --ignore-existing       skip updating files that already exist on receiver
     --remove-source-files   sender removes synchronized files (non-dirs)
     --del                   an alias for --delete-during
     --delete                delete extraneous files from destination dirs
     --delete-before         receiver deletes before transfer, not during
     --delete-during         receiver deletes during the transfer
     --delete-delay          find deletions during, delete after
     --delete-after          receiver deletes after transfer, not during
     --delete-excluded       also delete excluded files from destination dirs
     --ignore-errors         delete even if there are I/O errors
     --force                 force deletion of directories even if not empty
     --max-delete=NUM        don't delete more than NUM files
     --max-size=SIZE         don't transfer any file larger than SIZE
     --min-size=SIZE         don't transfer any file smaller than SIZE
     --partial               keep partially transferred files
     --partial-dir=DIR       put a partially transferred file into DIR
     --delay-updates         put all updated files into place at transfer's end
 -m, --prune-empty-dirs      prune empty directory chains from the file-list
     --numeric-ids           don't map uid/gid values by user/group name
     --timeout=SECONDS       set I/O timeout in seconds
     --contimeout=SECONDS    set daemon connection timeout in seconds
 -I, --ignore-times          don't skip files that match in size and mod-time
     --size-only             skip files that match in size
     --modify-window=NUM     compare mod-times with reduced accuracy
 -T, --temp-dir=DIR          create temporary files in directory DIR
 -y, --fuzzy                 find similar file for basis if no dest file
     --compare-dest=DIR      also compare destination files relative to DIR
     --copy-dest=DIR         … and include copies of unchanged files
     --link-dest=DIR         hardlink to files in DIR when unchanged
 -z, --compress              compress file data during the transfer
     --compress-level=NUM    explicitly set compression level
     --skip-compress=LIST    skip compressing files with a suffix in LIST
 -C, --cvs-exclude           auto-ignore files the same way CVS does
 -f, --filter=RULE           add a file-filtering RULE
 -F                          same as --filter='dir-merge /.rsync-filter'
                             repeated: --filter='- .rsync-filter'
     --exclude=PATTERN       exclude files matching PATTERN
     --exclude-from=FILE     read exclude patterns from FILE
     --include=PATTERN       don't exclude files matching PATTERN
     --include-from=FILE     read include patterns from FILE
     --files-from=FILE       read list of source-file names from FILE
 -0, --from0                 all *-from/filter files are delimited by 0s
 -s, --protect-args          no space-splitting; only wildcard special-chars
     --address=ADDRESS       bind address for outgoing socket to daemon
     --port=PORT             specify double-colon alternate port number
     --sockopts=OPTIONS      specify custom TCP options
     --blocking-io           use blocking I/O for the remote shell
     --stats                 give some file-transfer stats
 -8, --8-bit-output          leave high-bit chars unescaped in output
 -h, --human-readable        output numbers in a human-readable format
     --progress              show progress during transfer
 -P                          same as --partial --progress
 -i, --itemize-changes       output a change-summary for all updates
     --out-format=FORMAT     output updates using the specified FORMAT
     --log-file=FILE         log what we're doing to the specified FILE
     --log-file-format=FMT   log updates using the specified FMT
     --password-file=FILE    read daemon-access password from FILE
     --list-only             list the files instead of copying them
     --bwlimit=KBPS          limit I/O bandwidth; KBytes per second
     --write-batch=FILE      write a batched update to FILE
     --only-write-batch=FILE like --write-batch but w/o updating destination
     --read-batch=FILE       read a batched update from FILE
     --protocol=NUM          force an older protocol version to be used
     --iconv=CONVERT_SPEC    request charset conversion of filenames
     --checksum-seed=NUM     set block/file checksum seed (advanced)
 -4, --ipv4                  prefer IPv4
 -6, --ipv6                  prefer IPv6
     --version               print version number
(-h) --help                  show this help (-h is --help only if used alone)</pre>



<p>Although there are many options, the most common combination of options is &#8220;avz&#8221;, which compresses and displays some information and transmits it in archive mode.</p>



<h2><strong>Use of rsync</strong></h2>



<p><strong>Synchronize data on the local disk</strong></p>



<p>The following commands synchronize individual files on your local computer from one location to another.</p>



<pre class="wp-block-preformatted">rsync -zvh backup.tar /tmp/backup/</pre>



<figure class="wp-block-image"><img loading="lazy" width="646" height="90" src="//1723336065.rsc.cdn77.org/wp-content/uploads/2019/10/rsync.png" alt="" class="wp-image-14522" srcset="https://www.osradar.com/wp-content/uploads/2019/10/rsync.png 646w, https://www.osradar.com/wp-content/uploads/2019/10/rsync-300x42.png 300w" sizes="(max-width: 646px) 100vw, 646px" /><figcaption>rsync</figcaption></figure>



<p>We can use it &#8216;&#8211;progress &#8216;option. It shows the file that was transferred and the time remaining.</p>



<pre class="wp-block-preformatted">rsync -zvh backup.tar /tmp/backup/ --progress</pre>



<figure class="wp-block-image is-resized"><img loading="lazy" src="//1723336065.rsc.cdn77.org/wp-content/uploads/2019/10/progress.png" alt="" class="wp-image-14521" width="693" height="128" srcset="https://www.osradar.com/wp-content/uploads/2019/10/progress.png 646w, https://www.osradar.com/wp-content/uploads/2019/10/progress-300x55.png 300w" sizes="(max-width: 693px) 100vw, 693px" /><figcaption> transferred and the time remaining </figcaption></figure>



<p>The commands will transfer or synchronize all files in the same directory to different directories on the same computer.</p>



<pre class="wp-block-preformatted">rsync -avzh /root/tomcat/ /tmp/backup/tomcat/ --progress</pre>



<figure class="wp-block-image"><img loading="lazy" width="828" height="141" src="//1723336065.rsc.cdn77.org/wp-content/uploads/2019/10/dic.png" alt="" class="wp-image-14523" srcset="https://www.osradar.com/wp-content/uploads/2019/10/dic.png 828w, https://www.osradar.com/wp-content/uploads/2019/10/dic-300x51.png 300w, https://www.osradar.com/wp-content/uploads/2019/10/dic-768x131.png 768w, https://www.osradar.com/wp-content/uploads/2019/10/dic-696x119.png 696w" sizes="(max-width: 828px) 100vw, 828px" /></figure>



<h4>Use the &#8211;include and &#8211;exclude options  </h4>



<p><br>These two options allow us to include exclude files and folders by specifying parameters with which these options can help us specify which files and folders to include and exclude during synchronization. You do not want to be moved to these files or directories.<br>Here, in this example, the rsync command will include only those files and directories that end with a &#8220;log&#8221; and exclude end with a &#8220;war&#8221;  files and directories.</p>



<pre class="wp-block-preformatted">rsync -avzh  --include '*<em>log' --exclude '</em>*war' /root/tomcat/ /tmp/backup/tomcat/ --progress</pre>



<figure class="wp-block-image is-resized"><img loading="lazy" src="//1723336065.rsc.cdn77.org/wp-content/uploads/2019/10/企业微信截图_15707657927042.png" alt="" class="wp-image-14524" width="691" height="445" srcset="https://www.osradar.com/wp-content/uploads/2019/10/企业微信截图_15707657927042.png 644w, https://www.osradar.com/wp-content/uploads/2019/10/企业微信截图_15707657927042-300x193.png 300w" sizes="(max-width: 691px) 100vw, 691px" /><figcaption>show</figcaption></figure>



<h4> Use the &#8211;delete</h4>



<p>If the file or directory does not exist at the source but already exists at the destination, you may need to delete the existing file/directory at the destination during synchronization.</p>



<p>We can use the &#8216;&#8211;delete&#8217; option to delete files that do not exist in the source directory. Source and target are synchronized. Now, create a new target file, test.txt.</p>



<pre class="wp-block-preformatted">touch /tmp/backup/tomcat/123.txt
ls /tmp/backup/tomcat/          
rsync -avzh --delete  /root/tomcat/ /tmp/backup/tomcat/ --progress
ls /tmp/backup/tomcat/                                            </pre>



<figure class="wp-block-image"><img loading="lazy" width="1024" height="184" src="//1723336065.rsc.cdn77.org/wp-content/uploads/2019/10/企业微信截图_15707736326750-1024x184.png" alt="" class="wp-image-14525" srcset="https://www.osradar.com/wp-content/uploads/2019/10/企业微信截图_15707736326750-1024x184.png 1024w, https://www.osradar.com/wp-content/uploads/2019/10/企业微信截图_15707736326750-300x54.png 300w, https://www.osradar.com/wp-content/uploads/2019/10/企业微信截图_15707736326750-768x138.png 768w, https://www.osradar.com/wp-content/uploads/2019/10/企业微信截图_15707736326750-696x125.png 696w, https://www.osradar.com/wp-content/uploads/2019/10/企业微信截图_15707736326750.png 1067w" sizes="(max-width: 1024px) 100vw, 1024px" /><figcaption> &#8216;&#8211;delete&#8217; option to delete files </figcaption></figure>



<p>The target has the name test.txt, and when synchronizing the new file with the source of the &#8216;-delete&#8217; option, it removes the file test.txt.</p>



<h4>Sets the maximum size of the file to transfer</h4>



<p>You can do this with the &#8212; max-size option. Here, in this example, the maximum file size is 200K, so the command will only pass smaller files equal to or greater than 200K.</p>



<pre class="wp-block-preformatted">rsync -avzh --max-size='200k'  /root/tomcat/ /tmp/backup/tomcat/ --progress</pre>



<figure class="wp-block-image"><img loading="lazy" width="937" height="369" src="//1723336065.rsc.cdn77.org/wp-content/uploads/2019/10/企业微信截图_1570774452934.png" alt="" class="wp-image-14526" srcset="https://www.osradar.com/wp-content/uploads/2019/10/企业微信截图_1570774452934.png 937w, https://www.osradar.com/wp-content/uploads/2019/10/企业微信截图_1570774452934-300x118.png 300w, https://www.osradar.com/wp-content/uploads/2019/10/企业微信截图_1570774452934-768x302.png 768w, https://www.osradar.com/wp-content/uploads/2019/10/企业微信截图_1570774452934-696x274.png 696w" sizes="(max-width: 937px) 100vw, 937px" /><figcaption>  file size &lt;200k</figcaption></figure>



<h4>Set bandwidth limits and transfer files</h4>



<p>You can transfer data from one machine to another at the same time with the help of the &#8216;&#8211;bwlimit&#8217; option. This option helps limit I/O bandwidth.</p>



<pre class="wp-block-preformatted">rsync -avzh --bwlimit=10  /root/tomcat/ /tmp/backup/tomcat/ --progress
rsync -avzh --bwlimit=50  /root/tomcat/ /tmp/backup/tomcat/ --progress</pre>



<figure class="wp-block-image"><img loading="lazy" width="996" height="160" src="//1723336065.rsc.cdn77.org/wp-content/uploads/2019/10/企业微信截图_15707748512246.png" alt="" class="wp-image-14527" srcset="https://www.osradar.com/wp-content/uploads/2019/10/企业微信截图_15707748512246.png 996w, https://www.osradar.com/wp-content/uploads/2019/10/企业微信截图_15707748512246-300x48.png 300w, https://www.osradar.com/wp-content/uploads/2019/10/企业微信截图_15707748512246-768x123.png 768w, https://www.osradar.com/wp-content/uploads/2019/10/企业微信截图_15707748512246-696x112.png 696w" sizes="(max-width: 996px) 100vw, 996px" /><figcaption>Different bandwidth Settings have different speeds</figcaption></figure>



<h3><strong> Remotely synchronize data  using ssh-based rsync</strong></h3>



<p>Through the introduction of synchronizing data on a local disk, we learned about the most common options. The options for remote transport are the same as for local transport. So we&#8217;ll cover only the basic format of remote transmission. If you need to use other options, you can choose according to the above description</p>



<h4>Use SSH to copy files from the local server to the remote server</h4>



<p>To specify the protocol to use rsync, you need to give the protocol you want to use the &#8220;-e&#8221; option. Here, in this example, we will use &#8220;SSH&#8221; with the &#8220;-e&#8221; option &#8220;-p&#8221; to specify the transport port and perform the data transfer.</p>



<pre class="wp-block-preformatted">rsync -zvh -e "ssh -p12598" backup.tar root@172.16.6.250:/tmp/backup/ --progress</pre>



<figure class="wp-block-image"><img loading="lazy" width="1002" height="177" src="//1723336065.rsc.cdn77.org/wp-content/uploads/2019/10/企业微信截图_15707760268792.png" alt="" class="wp-image-14528" srcset="https://www.osradar.com/wp-content/uploads/2019/10/企业微信截图_15707760268792.png 1002w, https://www.osradar.com/wp-content/uploads/2019/10/企业微信截图_15707760268792-300x53.png 300w, https://www.osradar.com/wp-content/uploads/2019/10/企业微信截图_15707760268792-768x136.png 768w, https://www.osradar.com/wp-content/uploads/2019/10/企业微信截图_15707760268792-696x123.png 696w" sizes="(max-width: 1002px) 100vw, 1002px" /></figure>



<h4>Copy files from remote server to local server via SSH </h4>



<pre class="wp-block-preformatted">rsync -zvh -e "ssh -p12598"  root@172.16.6.250:/tmp/backup/*  /tmp/  --progress</pre>



<figure class="wp-block-image"><img loading="lazy" width="948" height="98" src="//1723336065.rsc.cdn77.org/wp-content/uploads/2019/10/企业微信截图_15707764389100.png" alt="" class="wp-image-14529" srcset="https://www.osradar.com/wp-content/uploads/2019/10/企业微信截图_15707764389100.png 948w, https://www.osradar.com/wp-content/uploads/2019/10/企业微信截图_15707764389100-300x31.png 300w, https://www.osradar.com/wp-content/uploads/2019/10/企业微信截图_15707764389100-768x79.png 768w, https://www.osradar.com/wp-content/uploads/2019/10/企业微信截图_15707764389100-696x72.png 696w" sizes="(max-width: 948px) 100vw, 948px" /></figure>



<h2><strong>conclusion</strong></h2>



<p>The above article introduced two working modes of rsync: local transmission and remote transmission via SSH protocol. The third working mode is transmission via rsync Daemon. <a href="https://www.google.com/search?q=rsync+daemon">Rsync Daemon</a> commands are basically the same as using SSH. The only change is that the destination address is transferred according to the alias defined in Rsync Daemon instead of IP. </p>



<p>If you want to know more about rsync, please leave me a message To learn more about Linux, please follow <a href="https://www.osradar.com/author/sky/">my link</a>. Thank you </p>
<p>The post <a rel="nofollow" href="https://www.osradar.com/synchronous-data-using-rsync-command-in-linux/">Synchronous data Using rsync Command in 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/synchronous-data-using-rsync-command-in-linux/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>The Linux systemctl command</title>
		<link>https://www.osradar.com/the-linux-systemctl-command/</link>
					<comments>https://www.osradar.com/the-linux-systemctl-command/#respond</comments>
		
		<dc:creator><![CDATA[angeloma]]></dc:creator>
		<pubDate>Thu, 10 Oct 2019 22:08:29 +0000</pubDate>
				<category><![CDATA[Desktop]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[command]]></category>
		<category><![CDATA[linux command]]></category>
		<category><![CDATA[systemctl]]></category>
		<category><![CDATA[systemctl command]]></category>
		<category><![CDATA[terminal]]></category>
		<category><![CDATA[Tutorial]]></category>
		<guid isPermaLink="false">https://www.osradar.com/?p=14256</guid>

					<description><![CDATA[<p>In many of our tutorials we have to manage services but what are these services? How are they handled? Well, basically they can be handled with the systemctl command. And in this post, I will teach you how to use the Linux systemctl command. At least so that you can manage the computer services in [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://www.osradar.com/the-linux-systemctl-command/">The Linux systemctl 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>In many of our tutorials we have to manage services but what are these services? How are they handled? Well, basically they can be handled with the systemctl command. And in this post, I will teach you how to use the Linux systemctl command. At least so that you can manage the computer services in a fast and basic way.</p>
<h2>What is a system service?</h2>
<p>A system service is usually an application that runs in the background. That is to say that it is not necessary that they have a constant interaction with the user to be able to work. This concept is vital to any modern operating system. Some of the most essential applications of a server are managed as services, for example, <a href="https://www.osradar.com/termius-is-a-powefull-ssh-client/" target="_blank" rel="noopener noreferrer">SSH</a> or <a href="https://osradar.com/tag/mysql/" target="_blank" rel="noopener noreferrer">MySQL</a>.</p>
<p>Well, services are handled in Linux with a command that is systemctl. This is because, since recent versions of the kernel and the main current Linux distributions, Systemd is in charge of managing the services.</p>
<p>So we will see how to use the Linux systemctl command.</p>
<h2>The Linux systemctl command</h2>
<p>Within our Linux system, the main function of the systemctl command is to administer the system services. Or those applications that are managed as a service.</p>
<p>First, it is a command that requires root privileges to function. This means that either we enable sudo for our user or we will have to be the root user.</p>
<p><a href="https://www.osradar.com/how-to-enable-sudo-on-debian-10/" target="_blank" rel="noopener noreferrer">How to enable sudo on Debian 10?</a></p>
<p>How to enable sudo on CentOS 8?</p>
<p>Now, we will be able to list all the services that are in our system, for it uses the following command</p>
<pre>:~# systemctl -t list-unit-files --all</pre>
<p>It is also useful to list all active services. To do this, just use:</p>
<pre>:~# systemctl list-unit</pre>
<p>Once we know what the services are, we can work with them.</p>
<p>To start a service that is stopped the syntax is as follows:</p>
<pre>:~# systemctl start [service_name]</pre>
<p>For example:</p>
<pre>:~# systemctl start apache2</pre>
<p>To stop it:</p>
<pre>:~# systemctl stop [service_name]</pre>
<p>Sometimes we make changes to the service and for them to take effect it is necessary to restart it. To do this, we use the following command:</p>
<pre>~# systemctl restart [service_name]</pre>
<p>However, many of these changes are at the configuration level. In this case, the service has to be recharged.</p>
<pre>:~# systemctl reload [service_name]</pre>
<p>It is also possible to restart a service that is currently running:</p>
<pre>:~# systemctl condrestart [service_name]</pre>
<p>And if you want to know the status of a service:</p>
<pre>:~# systemctl status [service_name]</pre>
<p>This function is quite interesting about the status of the service. Because we will be able to have in detail if a service is running or not. And if at the moment of initiating it gives an error, also with this command we will be able to make the pursuit of him.</p>
<p>If you want a service to run automatically with the system, you can do it with the following command:</p>
<pre>:~# systemctl enable [service_name]</pre>
<p>If you no longer wish it to be so, reverse it with this other command:</p>
<pre>:~# systemctl disable [service_name]</pre>
<p>And that is it. I hope this little guide can help you with systemctl.</p>
<h2>Conclusion</h2>
<p>Using and managing the system&#8217;s services on Linux is not a completely simple task, but it is not as difficult as we think. In this sense, systemctl is a relatively simple command that will help us with the management of them.</p>
<p>Please share this post, with your friends and join <a href="https://t.me/osradar" target="_blank" rel="noopener noreferrer">our Telegram channel</a>.</p>
<p>The post <a rel="nofollow" href="https://www.osradar.com/the-linux-systemctl-command/">The Linux systemctl 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-systemctl-command/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Linux Nmap network scanning tool installation and use</title>
		<link>https://www.osradar.com/linux-nmap-network-scanning-tool-installation-and-use/</link>
					<comments>https://www.osradar.com/linux-nmap-network-scanning-tool-installation-and-use/#respond</comments>
		
		<dc:creator><![CDATA[Mel]]></dc:creator>
		<pubDate>Thu, 03 Oct 2019 07:27:26 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[command]]></category>
		<category><![CDATA[linux tool]]></category>
		<category><![CDATA[monitoring tools]]></category>
		<category><![CDATA[network]]></category>
		<guid isPermaLink="false">https://www.osradar.com/?p=14148</guid>

					<description><![CDATA[<p>This paper introduces the installation and use of the Nmap network scanning tool under centos. NMAP is a popular network scanning and sniffing tools is also a powerful tool for port scanning type safety assessment, is widely used in the security scan, NMAP is a useful online tool, also is often used in the production [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://www.osradar.com/linux-nmap-network-scanning-tool-installation-and-use/">Linux Nmap network scanning tool installation and use</a> appeared first on <a rel="nofollow" href="https://www.osradar.com">Linux  Windows and android  Tutorials</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>This paper introduces the installation and use of the Nmap network scanning tool under centos.</p>



<p>NMAP is a popular network scanning and sniffing tools is also a powerful tool for port scanning type safety assessment, is widely used in the security scan, NMAP is a useful online tool, also is often used in the production and development, mainly for port open view of detection and LAN information collection, etc., different Linux distributions generally also with NMAP package management tool, can also choose to go to the website to <a href="https://nmap.org/">download </a>the source code package compiled installation.</p>



<h3><strong> Install nmap</strong></h3>



<p> In case, you are unable to use nmap command, use below command to install it </p>



<pre class="wp-block-preformatted"> centos：yum install nmap
 ubuntu：apt-get install nmap  </pre>



<figure class="wp-block-image"><img loading="lazy" width="1024" height="171" src="//1723336065.rsc.cdn77.org/wp-content/uploads/2019/10/install-1024x171.png" alt="centos install nmap" class="wp-image-14156" srcset="https://www.osradar.com/wp-content/uploads/2019/10/install-1024x171.png 1024w, https://www.osradar.com/wp-content/uploads/2019/10/install-300x50.png 300w, https://www.osradar.com/wp-content/uploads/2019/10/install-768x128.png 768w, https://www.osradar.com/wp-content/uploads/2019/10/install-696x116.png 696w, https://www.osradar.com/wp-content/uploads/2019/10/install-1068x178.png 1068w, https://www.osradar.com/wp-content/uploads/2019/10/install.png 1285w" sizes="(max-width: 1024px) 100vw, 1024px" /><figcaption>centos install nmap</figcaption></figure>



<p>Check that the installation is successful</p>



<pre class="wp-block-preformatted"> nmap -v</pre>



<figure class="wp-block-image"><img loading="lazy" width="971" height="113" src="//1723336065.rsc.cdn77.org/wp-content/uploads/2019/10/check.png" alt="" class="wp-image-14157" srcset="https://www.osradar.com/wp-content/uploads/2019/10/check.png 971w, https://www.osradar.com/wp-content/uploads/2019/10/check-300x35.png 300w, https://www.osradar.com/wp-content/uploads/2019/10/check-768x89.png 768w, https://www.osradar.com/wp-content/uploads/2019/10/check-696x81.png 696w" sizes="(max-width: 971px) 100vw, 971px" /><figcaption> Check </figcaption></figure>



<h4><strong>Nmap usage method</strong></h4>



<ul><li>Scan IP  which common TCP port and UDP port are open</li></ul>



<pre class="wp-block-preformatted">nmap 127.0.0.1 or nmap -sS -sU -p 1-65535 127.0.0.1</pre>



<figure class="wp-block-image"><img loading="lazy" width="816" height="225" src="//1723336065.rsc.cdn77.org/wp-content/uploads/2019/10/ip.png" alt="" class="wp-image-14158" srcset="https://www.osradar.com/wp-content/uploads/2019/10/ip.png 816w, https://www.osradar.com/wp-content/uploads/2019/10/ip-300x83.png 300w, https://www.osradar.com/wp-content/uploads/2019/10/ip-768x212.png 768w, https://www.osradar.com/wp-content/uploads/2019/10/ip-696x192.png 696w" sizes="(max-width: 816px) 100vw, 816px" /><figcaption> Scan IP </figcaption></figure>



<ul><li>Scan multiple IP addresses or  subnet </li></ul>



<pre class="wp-block-preformatted">nmap 127.0.0.1 172.16.6.1
nmap 172.16.6.1-100
nmap 172.16.6.0/24  </pre>



<p>In the scan result, if the state column is open, it means the state is open; if it is filtered, it may be filtered by a firewall; if it is closed, it means the port is closed.</p>



<ul><li>Scans  which hosts are alive in the subnet</li></ul>



<pre class="wp-block-preformatted">nmap -n -sP 172.16.6.0/24</pre>



<figure class="wp-block-image"><img loading="lazy" width="1024" height="493" src="//1723336065.rsc.cdn77.org/wp-content/uploads/2019/10/subnet-1-1024x493.png" alt="" class="wp-image-14160" srcset="https://www.osradar.com/wp-content/uploads/2019/10/subnet-1-1024x493.png 1024w, https://www.osradar.com/wp-content/uploads/2019/10/subnet-1-300x144.png 300w, https://www.osradar.com/wp-content/uploads/2019/10/subnet-1-768x370.png 768w, https://www.osradar.com/wp-content/uploads/2019/10/subnet-1-696x335.png 696w, https://www.osradar.com/wp-content/uploads/2019/10/subnet-1-1068x514.png 1068w, https://www.osradar.com/wp-content/uploads/2019/10/subnet-1-872x420.png 872w, https://www.osradar.com/wp-content/uploads/2019/10/subnet-1.png 1296w" sizes="(max-width: 1024px) 100vw, 1024px" /><figcaption> Scan subnet  alive </figcaption></figure>



<ul><li>Nmap route trace</li></ul>



<pre class="wp-block-preformatted">namp –traceroute 8.8.8.8  </pre>



<figure class="wp-block-image is-resized"><img loading="lazy" src="//1723336065.rsc.cdn77.org/wp-content/uploads/2019/10/企业微信截图_15700149568763.png" alt="" class="wp-image-14168" width="708" height="337" srcset="https://www.osradar.com/wp-content/uploads/2019/10/企业微信截图_15700149568763.png 664w, https://www.osradar.com/wp-content/uploads/2019/10/企业微信截图_15700149568763-300x143.png 300w" sizes="(max-width: 708px) 100vw, 708px" /><figcaption>traceroute</figcaption></figure>



<ul><li>Scans IP or subnet hosts for port</li></ul>



<pre class="wp-block-preformatted">nmap -p 12598 127.0.0.1
nmap -p 12598 172.16.6.0/24</pre>



<figure class="wp-block-image"><img loading="lazy" width="1021" height="488" src="//1723336065.rsc.cdn77.org/wp-content/uploads/2019/10/port.png" alt="" class="wp-image-14161" srcset="https://www.osradar.com/wp-content/uploads/2019/10/port.png 1021w, https://www.osradar.com/wp-content/uploads/2019/10/port-300x143.png 300w, https://www.osradar.com/wp-content/uploads/2019/10/port-768x367.png 768w, https://www.osradar.com/wp-content/uploads/2019/10/port-696x333.png 696w, https://www.osradar.com/wp-content/uploads/2019/10/port-879x420.png 879w" sizes="(max-width: 1021px) 100vw, 1021px" /><figcaption> Scans port</figcaption></figure>



<ul><li>An option that goes one step further and gives you more information about the services running on a specific host is ‘-A’. </li></ul>



<pre class="wp-block-preformatted">nmap -A 127.0.0.1</pre>



<figure class="wp-block-image"><img loading="lazy" width="814" height="459" src="//1723336065.rsc.cdn77.org/wp-content/uploads/2019/10/all.png" alt="" class="wp-image-14162" srcset="https://www.osradar.com/wp-content/uploads/2019/10/all.png 814w, https://www.osradar.com/wp-content/uploads/2019/10/all-300x169.png 300w, https://www.osradar.com/wp-content/uploads/2019/10/all-768x433.png 768w, https://www.osradar.com/wp-content/uploads/2019/10/all-696x392.png 696w, https://www.osradar.com/wp-content/uploads/2019/10/all-745x420.png 745w" sizes="(max-width: 814px) 100vw, 814px" /><figcaption> all information </figcaption></figure>



<ul><li>Nmap scans the operating system type using the -O option</li></ul>



<pre class="wp-block-preformatted">nmap -O 12598 127.0.0.1</pre>



<figure class="wp-block-image"><img loading="lazy" width="757" height="239" src="//1723336065.rsc.cdn77.org/wp-content/uploads/2019/10/企业微信截图_157001514422.png" alt="" class="wp-image-14169" srcset="https://www.osradar.com/wp-content/uploads/2019/10/企业微信截图_157001514422.png 757w, https://www.osradar.com/wp-content/uploads/2019/10/企业微信截图_157001514422-300x95.png 300w, https://www.osradar.com/wp-content/uploads/2019/10/企业微信截图_157001514422-696x220.png 696w" sizes="(max-width: 757px) 100vw, 757px" /><figcaption> operating system type </figcaption></figure>



<ul><li> For an in-depth understanding of the use of the nmap command, use it to examine the man pages </li></ul>



<pre class="wp-block-preformatted">man nmap</pre>



<h4><strong>Conclusions</strong></h4>



<p style="text-align:left"><g class="gr_ gr_5 gr-alert gr_spell gr_inline_cards gr_run_anim ContextualSpelling ins-del multiReplace" id="5" data-gr-id="5">nmap</g> is one of those utilities that have so many options and capabilities, it can actually be overwhelming. As is the case with those types of utilities, you will end up using only a fraction of its capabilities to help get a specific job done. If you want to use it at its full potential, you’re in for a lot of trial and error and some hands-on experience with real networks. </p>



<p>So, you can read our post abour networks in <a href="https://www.osradar.com/tag/network/" target="_blank" rel="noreferrer noopener" aria-label="this (opens in a new tab)">this</a> link.</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/linux-nmap-network-scanning-tool-installation-and-use/">Linux Nmap network scanning tool installation and use</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/linux-nmap-network-scanning-tool-installation-and-use/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Use the ss  to display more socket connection information in Linux</title>
		<link>https://www.osradar.com/use-the-ss-to-display-more-socket-connection-information-in-linux/</link>
					<comments>https://www.osradar.com/use-the-ss-to-display-more-socket-connection-information-in-linux/#respond</comments>
		
		<dc:creator><![CDATA[Mel]]></dc:creator>
		<pubDate>Sun, 29 Sep 2019 11:09:18 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[command]]></category>
		<category><![CDATA[network]]></category>
		<category><![CDATA[tools]]></category>
		<guid isPermaLink="false">https://www.osradar.com/?p=14040</guid>

					<description><![CDATA[<p>Ss is an abbreviation for Socket Statistics. As the name suggests, the ss command can be used to get socket statistics, which can display something similar to netstat. The advantage of ss is that it can display more detailed information about TCP and connection status, and is faster and more efficient than netstat. When the [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://www.osradar.com/use-the-ss-to-display-more-socket-connection-information-in-linux/">Use the ss  to display more socket connection information in Linux</a> appeared first on <a rel="nofollow" href="https://www.osradar.com">Linux  Windows and android  Tutorials</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<figure class="wp-block-image"><img loading="lazy" width="1024" height="642" src="//1723336065.rsc.cdn77.org/wp-content/uploads/2019/09/ss-1024x642.jpg" alt="" class="wp-image-14041" srcset="https://www.osradar.com/wp-content/uploads/2019/09/ss-1024x642.jpg 1024w, https://www.osradar.com/wp-content/uploads/2019/09/ss-300x188.jpg 300w, https://www.osradar.com/wp-content/uploads/2019/09/ss-768x481.jpg 768w, https://www.osradar.com/wp-content/uploads/2019/09/ss-696x436.jpg 696w, https://www.osradar.com/wp-content/uploads/2019/09/ss-1068x670.jpg 1068w, https://www.osradar.com/wp-content/uploads/2019/09/ss-670x420.jpg 670w, https://www.osradar.com/wp-content/uploads/2019/09/ss.jpg 1233w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>



<p>Ss is an abbreviation for Socket Statistics. As the name suggests, the ss command can be used to get socket statistics, which can display something similar to netstat. The advantage of ss is that it can display more detailed information about TCP and connection status, and is faster and more efficient than netstat.</p>



<p>When the number of socket connections on the server becomes very large, either using the netstat command or directly cat /proc/net/tcp, the execution speed will be slow.</p>



<p>The secret of ss is that it uses tcp_diag in the TCP stack. Tcp_diag is a module for analyzing statistics, which can get the first-hand information in the Linux kernel, which ensures the fast and efficient ss.</p>



<h3><strong>Intsall ss</strong></h3>



<p> In case, you are unable to use ss command, use below command to install it. </p>



<pre class="wp-block-preformatted"> yum install iproute iproute-doc </pre>



<figure class="wp-block-image is-resized"><img loading="lazy" src="//1723336065.rsc.cdn77.org/wp-content/uploads/2019/09/企业微信截图_15697270902641.png" alt="" class="wp-image-14043" width="694" height="331" srcset="https://www.osradar.com/wp-content/uploads/2019/09/企业微信截图_15697270902641.png 803w, https://www.osradar.com/wp-content/uploads/2019/09/企业微信截图_15697270902641-300x143.png 300w, https://www.osradar.com/wp-content/uploads/2019/09/企业微信截图_15697270902641-768x367.png 768w, https://www.osradar.com/wp-content/uploads/2019/09/企业微信截图_15697270902641-696x333.png 696w" sizes="(max-width: 694px) 100vw, 694px" /></figure>



<p>Now it is installed and ready to use.<br>Below are some useful commands to monitor network connections. </p>



<h3><strong>List all </strong> <strong>socket</strong> <strong>connections</strong></h3>



<p>The basic ss command, with no options, lists only all connections, no matter what state they are in.</p>



<pre class="wp-block-preformatted">ss</pre>



<figure class="wp-block-image"><img loading="lazy" width="990" height="391" src="//1723336065.rsc.cdn77.org/wp-content/uploads/2019/09/企业微信截图_15697380999106.png" alt="" class="wp-image-14047" srcset="https://www.osradar.com/wp-content/uploads/2019/09/企业微信截图_15697380999106.png 990w, https://www.osradar.com/wp-content/uploads/2019/09/企业微信截图_15697380999106-300x118.png 300w, https://www.osradar.com/wp-content/uploads/2019/09/企业微信截图_15697380999106-768x303.png 768w, https://www.osradar.com/wp-content/uploads/2019/09/企业微信截图_15697380999106-696x275.png 696w" sizes="(max-width: 990px) 100vw, 990px" /></figure>



<h3><strong>List only TCP Ports connections </strong></h3>



<p> To see all TCP socket connections, use the -lt option</p>



<pre class="wp-block-preformatted">ss -lt </pre>



<figure class="wp-block-image"><img loading="lazy" width="990" height="391" src="//1723336065.rsc.cdn77.org/wp-content/uploads/2019/09/企业微信截图_15697381288682.png" alt="" class="wp-image-14048" srcset="https://www.osradar.com/wp-content/uploads/2019/09/企业微信截图_15697381288682.png 990w, https://www.osradar.com/wp-content/uploads/2019/09/企业微信截图_15697381288682-300x118.png 300w, https://www.osradar.com/wp-content/uploads/2019/09/企业微信截图_15697381288682-768x303.png 768w, https://www.osradar.com/wp-content/uploads/2019/09/企业微信截图_15697381288682-696x275.png 696w" sizes="(max-width: 990px) 100vw, 990px" /></figure>



<h3><strong>List only UDP Ports connections</strong> </h3>



<p>To see all UDP socket connections, use the -ua option</p>



<pre class="wp-block-preformatted">ss -ua</pre>



<figure class="wp-block-image"><img loading="lazy" width="990" height="391" src="//1723336065.rsc.cdn77.org/wp-content/uploads/2019/09/企业微信截图_15697381424034.png" alt="" class="wp-image-14049" srcset="https://www.osradar.com/wp-content/uploads/2019/09/企业微信截图_15697381424034.png 990w, https://www.osradar.com/wp-content/uploads/2019/09/企业微信截图_15697381424034-300x118.png 300w, https://www.osradar.com/wp-content/uploads/2019/09/企业微信截图_15697381424034-768x303.png 768w, https://www.osradar.com/wp-content/uploads/2019/09/企业微信截图_15697381424034-696x275.png 696w" sizes="(max-width: 990px) 100vw, 990px" /></figure>



<h3><strong>Display socket PID (process ID)</strong></h3>



<p>To display the process ID associated with the socket connection, use the -p option </p>



<pre class="wp-block-preformatted">ss -p</pre>



<figure class="wp-block-image is-resized"><img loading="lazy" src="//1723336065.rsc.cdn77.org/wp-content/uploads/2019/09/企业微信截图_15697384962245-1024x479.png" alt="" class="wp-image-14052" width="688" height="321" srcset="https://www.osradar.com/wp-content/uploads/2019/09/企业微信截图_15697384962245-1024x479.png 1024w, https://www.osradar.com/wp-content/uploads/2019/09/企业微信截图_15697384962245-300x140.png 300w, https://www.osradar.com/wp-content/uploads/2019/09/企业微信截图_15697384962245-768x359.png 768w, https://www.osradar.com/wp-content/uploads/2019/09/企业微信截图_15697384962245-696x325.png 696w, https://www.osradar.com/wp-content/uploads/2019/09/企业微信截图_15697384962245-1068x499.png 1068w, https://www.osradar.com/wp-content/uploads/2019/09/企业微信截图_15697384962245-898x420.png 898w, https://www.osradar.com/wp-content/uploads/2019/09/企业微信截图_15697384962245.png 1668w" sizes="(max-width: 688px) 100vw, 688px" /></figure>



<h3><strong>Display summary statistics</strong></h3>



<p>To list summary statistics, use the -s option</p>



<pre class="wp-block-preformatted">ss -s</pre>



<figure class="wp-block-image"><img loading="lazy" width="990" height="391" src="//1723336065.rsc.cdn77.org/wp-content/uploads/2019/09/企业微信截图_15697381507043.png" alt="" class="wp-image-14050" srcset="https://www.osradar.com/wp-content/uploads/2019/09/企业微信截图_15697381507043.png 990w, https://www.osradar.com/wp-content/uploads/2019/09/企业微信截图_15697381507043-300x118.png 300w, https://www.osradar.com/wp-content/uploads/2019/09/企业微信截图_15697381507043-768x303.png 768w, https://www.osradar.com/wp-content/uploads/2019/09/企业微信截图_15697381507043-696x275.png 696w" sizes="(max-width: 990px) 100vw, 990px" /></figure>



<h3><strong>Filter connections by port number</strong></h3>



<p>The ss command also allows you to filter socket port Numbers or address Numbers</p>



<pre class="wp-block-preformatted">ss -at '( dport = :12598 or sport = :12598 )' </pre>



<figure class="wp-block-image is-resized"><img loading="lazy" src="//1723336065.rsc.cdn77.org/wp-content/uploads/2019/09/企业微信截图_15697381671421.png" alt="" class="wp-image-14051" width="696" height="274" srcset="https://www.osradar.com/wp-content/uploads/2019/09/企业微信截图_15697381671421.png 990w, https://www.osradar.com/wp-content/uploads/2019/09/企业微信截图_15697381671421-300x118.png 300w, https://www.osradar.com/wp-content/uploads/2019/09/企业微信截图_15697381671421-768x303.png 768w, https://www.osradar.com/wp-content/uploads/2019/09/企业微信截图_15697381671421-696x275.png 696w" sizes="(max-width: 696px) 100vw, 696px" /></figure>



<h3><strong>Check the ss commands in the man page</strong></h3>



<p>For an in-depth understanding of the use of the ss command, use it to examine the man pages</p>



<pre class="wp-block-preformatted">man ss</pre>



<figure class="wp-block-image"><img loading="lazy" width="1024" height="479" src="//1723336065.rsc.cdn77.org/wp-content/uploads/2019/09/企业微信截图_1569738775653-1024x479.png" alt="" class="wp-image-14054" srcset="https://www.osradar.com/wp-content/uploads/2019/09/企业微信截图_1569738775653-1024x479.png 1024w, https://www.osradar.com/wp-content/uploads/2019/09/企业微信截图_1569738775653-300x140.png 300w, https://www.osradar.com/wp-content/uploads/2019/09/企业微信截图_1569738775653-768x359.png 768w, https://www.osradar.com/wp-content/uploads/2019/09/企业微信截图_1569738775653-696x325.png 696w, https://www.osradar.com/wp-content/uploads/2019/09/企业微信截图_1569738775653-1068x499.png 1068w, https://www.osradar.com/wp-content/uploads/2019/09/企业微信截图_1569738775653-898x420.png 898w, https://www.osradar.com/wp-content/uploads/2019/09/企业微信截图_1569738775653.png 1668w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>



<p>These are some of the common options used with the ss command. This command is considered more advanced than the netstat command and provides detailed information about the network connection.</p>



<p><strong>In conclusion</strong>:The ss command is a tool for displaying network socket-related information on a Linux system. The tool displays more details about the netstat command used to display active socket connections.</p>


<p class="wp-block-tag-cloud"><a href="https://www.osradar.com/tag/android/" class="tag-cloud-link tag-link-62 tag-link-position-1" style="font-size: 16.87323943662pt;" aria-label="android (260 items)">android</a>
<a href="https://www.osradar.com/tag/apache/" class="tag-cloud-link tag-link-127 tag-link-position-2" style="font-size: 10.366197183099pt;" aria-label="Apache (56 items)">Apache</a>
<a href="https://www.osradar.com/tag/bionic/" class="tag-cloud-link tag-link-1101 tag-link-position-3" style="font-size: 10.267605633803pt;" aria-label="bionic (55 items)">bionic</a>
<a href="https://www.osradar.com/tag/buster/" class="tag-cloud-link tag-link-1945 tag-link-position-4" style="font-size: 11.943661971831pt;" aria-label="Buster (83 items)">Buster</a>
<a href="https://www.osradar.com/tag/centos/" class="tag-cloud-link tag-link-72 tag-link-position-5" style="font-size: 14.30985915493pt;" aria-label="CentOS (145 items)">CentOS</a>
<a href="https://www.osradar.com/tag/centos-8/" class="tag-cloud-link tag-link-1987 tag-link-position-6" style="font-size: 9.9718309859155pt;" aria-label="Centos 8 (51 items)">Centos 8</a>
<a href="https://www.osradar.com/tag/database/" class="tag-cloud-link tag-link-785 tag-link-position-7" style="font-size: 10.366197183099pt;" aria-label="database (57 items)">database</a>
<a href="https://www.osradar.com/tag/databases/" class="tag-cloud-link tag-link-1492 tag-link-position-8" style="font-size: 10.760563380282pt;" aria-label="Databases (62 items)">Databases</a>
<a href="https://www.osradar.com/tag/debian/" class="tag-cloud-link tag-link-404 tag-link-position-9" style="font-size: 15.098591549296pt;" aria-label="debian (171 items)">debian</a>
<a href="https://www.osradar.com/tag/desktop/" class="tag-cloud-link tag-link-1984 tag-link-position-10" style="font-size: 8.1971830985915pt;" aria-label="desktop (34 items)">desktop</a>
<a href="https://www.osradar.com/tag/fedora/" class="tag-cloud-link tag-link-246 tag-link-position-11" style="font-size: 9.8732394366197pt;" aria-label="fedora (50 items)">fedora</a>
<a href="https://www.osradar.com/tag/focal/" class="tag-cloud-link tag-link-2874 tag-link-position-12" style="font-size: 12.830985915493pt;" aria-label="focal (102 items)">focal</a>
<a href="https://www.osradar.com/tag/focal-fossa/" class="tag-cloud-link tag-link-2873 tag-link-position-13" style="font-size: 13.028169014085pt;" aria-label="Focal Fossa (106 items)">Focal Fossa</a>
<a href="https://www.osradar.com/tag/google/" class="tag-cloud-link tag-link-225 tag-link-position-14" style="font-size: 15pt;" aria-label="google (168 items)">google</a>
<a href="https://www.osradar.com/tag/howto/" class="tag-cloud-link tag-link-792 tag-link-position-15" style="font-size: 18.056338028169pt;" aria-label="howto (346 items)">howto</a>
<a href="https://www.osradar.com/tag/how-to/" class="tag-cloud-link tag-link-84 tag-link-position-16" style="font-size: 17.859154929577pt;" aria-label="How to (330 items)">How to</a>
<a href="https://www.osradar.com/tag/how-to-tutorials/" class="tag-cloud-link tag-link-3150 tag-link-position-17" style="font-size: 8.7887323943662pt;" aria-label="how to tutorials (39 items)">how to tutorials</a>
<a href="https://www.osradar.com/tag/java/" class="tag-cloud-link tag-link-134 tag-link-position-18" style="font-size: 9.8732394366197pt;" aria-label="java (50 items)">java</a>
<a href="https://www.osradar.com/tag/linux/" class="tag-cloud-link tag-link-210 tag-link-position-19" style="font-size: 22pt;" aria-label="Linux (864 items)">Linux</a>
<a href="https://www.osradar.com/tag/linux-mint/" class="tag-cloud-link tag-link-443 tag-link-position-20" style="font-size: 8.5915492957746pt;" aria-label="linux mint (37 items)">linux mint</a>
<a href="https://www.osradar.com/tag/mariadb/" class="tag-cloud-link tag-link-951 tag-link-position-21" style="font-size: 9.6760563380282pt;" aria-label="mariadb (48 items)">mariadb</a>
<a href="https://www.osradar.com/tag/monitoring/" class="tag-cloud-link tag-link-801 tag-link-position-22" style="font-size: 8.4929577464789pt;" aria-label="monitoring (36 items)">monitoring</a>
<a href="https://www.osradar.com/tag/mysql/" class="tag-cloud-link tag-link-1235 tag-link-position-23" style="font-size: 9.1830985915493pt;" aria-label="mysql (43 items)">mysql</a>
<a href="https://www.osradar.com/tag/network/" class="tag-cloud-link tag-link-1102 tag-link-position-24" style="font-size: 8.3943661971831pt;" aria-label="network (35 items)">network</a>
<a href="https://www.osradar.com/tag/news/" class="tag-cloud-link tag-link-1341 tag-link-position-25" style="font-size: 10.56338028169pt;" aria-label="News (59 items)">News</a>
<a href="https://www.osradar.com/tag/new-version/" class="tag-cloud-link tag-link-1428 tag-link-position-26" style="font-size: 10.859154929577pt;" aria-label="New version (64 items)">New version</a>
<a href="https://www.osradar.com/tag/opensuse/" class="tag-cloud-link tag-link-561 tag-link-position-27" style="font-size: 9.2816901408451pt;" aria-label="opensuse (44 items)">opensuse</a>
<a href="https://www.osradar.com/tag/php/" class="tag-cloud-link tag-link-135 tag-link-position-28" style="font-size: 11.056338028169pt;" aria-label="PHP (66 items)">PHP</a>
<a href="https://www.osradar.com/tag/programming/" class="tag-cloud-link tag-link-776 tag-link-position-29" style="font-size: 14.211267605634pt;" aria-label="Programming (139 items)">Programming</a>
<a href="https://www.osradar.com/tag/rhel/" class="tag-cloud-link tag-link-69 tag-link-position-30" style="font-size: 9.5774647887324pt;" aria-label="RHEL (47 items)">RHEL</a>
<a href="https://www.osradar.com/tag/security/" class="tag-cloud-link tag-link-137 tag-link-position-31" style="font-size: 12.929577464789pt;" aria-label="Security (103 items)">Security</a>
<a href="https://www.osradar.com/tag/server/" class="tag-cloud-link tag-link-848 tag-link-position-32" style="font-size: 16.774647887324pt;" aria-label="server (259 items)">server</a>
<a href="https://www.osradar.com/tag/sql/" class="tag-cloud-link tag-link-1441 tag-link-position-33" style="font-size: 10.957746478873pt;" aria-label="SQL (65 items)">SQL</a>
<a href="https://www.osradar.com/tag/tools/" class="tag-cloud-link tag-link-800 tag-link-position-34" style="font-size: 9.9718309859155pt;" aria-label="tools (52 items)">tools</a>
<a href="https://www.osradar.com/tag/tutorial/" class="tag-cloud-link tag-link-86 tag-link-position-35" style="font-size: 19.535211267606pt;" aria-label="Tutorial (485 items)">Tutorial</a>
<a href="https://www.osradar.com/tag/ubuntu/" class="tag-cloud-link tag-link-71 tag-link-position-36" style="font-size: 17.169014084507pt;" aria-label="ubuntu (282 items)">ubuntu</a>
<a href="https://www.osradar.com/tag/unix/" class="tag-cloud-link tag-link-1170 tag-link-position-37" style="font-size: 8pt;" aria-label="unix (32 items)">unix</a>
<a href="https://www.osradar.com/tag/web/" class="tag-cloud-link tag-link-132 tag-link-position-38" style="font-size: 8.887323943662pt;" aria-label="web (40 items)">web</a>
<a href="https://www.osradar.com/tag/web-server/" class="tag-cloud-link tag-link-1253 tag-link-position-39" style="font-size: 8.0985915492958pt;" aria-label="web server (33 items)">web server</a>
<a href="https://www.osradar.com/tag/windows/" class="tag-cloud-link tag-link-98 tag-link-position-40" style="font-size: 17.661971830986pt;" aria-label="Windows (315 items)">Windows</a>
<a href="https://www.osradar.com/tag/windows-10/" class="tag-cloud-link tag-link-83 tag-link-position-41" style="font-size: 16.183098591549pt;" aria-label="Windows 10 (222 items)">Windows 10</a>
<a href="https://www.osradar.com/tag/windows-11/" class="tag-cloud-link tag-link-4007 tag-link-position-42" style="font-size: 11.450704225352pt;" aria-label="windows 11 (73 items)">windows 11</a>
<a href="https://www.osradar.com/tag/windows-server/" class="tag-cloud-link tag-link-65 tag-link-position-43" style="font-size: 9.4788732394366pt;" aria-label="Windows server (46 items)">Windows server</a>
<a href="https://www.osradar.com/tag/windows-server-2019/" class="tag-cloud-link tag-link-2144 tag-link-position-44" style="font-size: 10.464788732394pt;" aria-label="Windows server 2019 (58 items)">Windows server 2019</a>
<a href="https://www.osradar.com/tag/xiaomi/" class="tag-cloud-link tag-link-3291 tag-link-position-45" style="font-size: 8.4929577464789pt;" aria-label="Xiaomi (36 items)">Xiaomi</a></p><p>The post <a rel="nofollow" href="https://www.osradar.com/use-the-ss-to-display-more-socket-connection-information-in-linux/">Use the ss  to display more socket connection information in 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/use-the-ss-to-display-more-socket-connection-information-in-linux/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>How to use CURL command on Linux?</title>
		<link>https://www.osradar.com/how-to-use-curl-command-linux/</link>
					<comments>https://www.osradar.com/how-to-use-curl-command-linux/#respond</comments>
		
		<dc:creator><![CDATA[angeloma]]></dc:creator>
		<pubDate>Wed, 26 Dec 2018 19:00:20 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Unix]]></category>
		<category><![CDATA[command]]></category>
		<category><![CDATA[curl]]></category>
		<category><![CDATA[script]]></category>
		<category><![CDATA[server]]></category>
		<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[unix]]></category>
		<guid isPermaLink="false">https://www.osradar.com/?p=8710</guid>

					<description><![CDATA[<p>On our site, there are many tutorials that have helped you learn about Linux, but in them, there is a very particular command called CURL. For example, in the post where I taught you how to install Rust, I used it, but I didn&#8217;t explain what it is. Therefore, in this post, I will teach [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://www.osradar.com/how-to-use-curl-command-linux/">How to use CURL command on 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>On our site, there are many tutorials that have helped you learn about Linux, but in them, there is a very particular command called CURL. For example, in the post where I taught you <a href="https://www.osradar.com/install-rust-programming-language-linux/">how to install Rust</a>, I used it, but I didn&#8217;t explain what it is. Therefore, in this post, I will teach you how to use the CURL command on Linux.</p>
<p><a href="https://curl.haxx.se/" rel="noopener">CURL</a> is a command line tool and library for transferring data with URLs. Many download scripts or file transfers use CURL as a means to achieve this. In addition, CURL supports FTP, FTPS, Gopher, HTTP, HTTPS, IMAP, IMAPS, LDAP and many other protocols quite popular on networks.</p>
<p>On the other hand, the use of CURL is not limited exclusively to computers but to other devices that use UNIX such as cell phones, cars and is the transfer backend of many of the most popular applications in the world.</p>
<h1>Using CURL command on Linux</h1>
<p>The idea of this post is to show the use of CURL, not to do it in a theoretical way. The main idea is to do it through examples that demonstrate its use.</p>
<p>So, let&#8217;s start.</p>
<h2>1. Install CURL</h2>
<p>Obviously, the first step is to install CURL. It is really simple as it is available in the official repositories of most Linux distributions. So, its installation is limited to a single command.</p>
<p>For Debian, Ubuntu, <a href="https://www.osradar.com/speed-up-cinnamon/">Linux Mint</a> and derivates</p>
<pre class="">:~$ sudo apt install curl</pre>
<p><figure id="attachment_8730" aria-describedby="caption-attachment-8730" style="width: 741px" class="wp-caption alignnone"><img loading="lazy" class="size-full wp-image-8730" src="https://www.osradar.com/wp-content/uploads/2018/12/1-16.png" alt="1.- Install CURL" width="741" height="268" srcset="https://www.osradar.com/wp-content/uploads/2018/12/1-16.png 741w, https://www.osradar.com/wp-content/uploads/2018/12/1-16-300x109.png 300w" sizes="(max-width: 741px) 100vw, 741px" /><figcaption id="caption-attachment-8730" class="wp-caption-text">1.- Install CURL</figcaption></figure></p>
<p>If you use Fedora:</p>
<pre class="">:~$ sudo dnf install curl</pre>
<p>For CentOS and RHEL:</p>
<pre class="">:~$ yum install curl</pre>
<h2>2. Check the CURL version</h2>
<p>The second thing you should do is, check the CURL version. Important to know what news you have available. While it is not essential to have CURL updated to its latest version, it is also not crazy to do so.</p>
<pre class="">:~$ curl --version</pre>
<p><figure id="attachment_8731" aria-describedby="caption-attachment-8731" style="width: 1365px" class="wp-caption alignnone"><img loading="lazy" class="size-full wp-image-8731" src="https://www.osradar.com/wp-content/uploads/2018/12/2-16.png" alt="2.- Checking the CURL version" width="1365" height="177" srcset="https://www.osradar.com/wp-content/uploads/2018/12/2-16.png 1365w, https://www.osradar.com/wp-content/uploads/2018/12/2-16-300x39.png 300w, https://www.osradar.com/wp-content/uploads/2018/12/2-16-768x100.png 768w, https://www.osradar.com/wp-content/uploads/2018/12/2-16-1024x133.png 1024w, https://www.osradar.com/wp-content/uploads/2018/12/2-16-1068x138.png 1068w" sizes="(max-width: 1365px) 100vw, 1365px" /><figcaption id="caption-attachment-8731" class="wp-caption-text">2.- Checking the CURL version</figcaption></figure></p>
<h2>3. Display the content of an HTML</h2>
<p>A simple way to display the source code of an HTML site from the terminal is with CURL.</p>
<pre class="">:~$ curl http://website.com/page.html</pre>
<p>Of course, it is necessary that you place the complete website of your preference.</p>
<p><figure id="attachment_8732" aria-describedby="caption-attachment-8732" style="width: 1366px" class="wp-caption alignnone"><img loading="lazy" class="size-full wp-image-8732" src="https://www.osradar.com/wp-content/uploads/2018/12/3-16.png" alt="3.- Showing a HTML page on the terminal thanks to CURL command" width="1366" height="768" srcset="https://www.osradar.com/wp-content/uploads/2018/12/3-16.png 1366w, https://www.osradar.com/wp-content/uploads/2018/12/3-16-300x169.png 300w, https://www.osradar.com/wp-content/uploads/2018/12/3-16-768x432.png 768w, https://www.osradar.com/wp-content/uploads/2018/12/3-16-1024x576.png 1024w, https://www.osradar.com/wp-content/uploads/2018/12/3-16-1068x600.png 1068w, https://www.osradar.com/wp-content/uploads/2018/12/3-16-747x420.png 747w" sizes="(max-width: 1366px) 100vw, 1366px" /><figcaption id="caption-attachment-8732" class="wp-caption-text">3.- Showing an HTML page on the terminal thanks to CURL command</figcaption></figure></p>
<h2>4. Download a file with CURL</h2>
<p>This is one of the most common uses we give to CURL. Downloading a file is a really simple task.</p>
<pre class="">:~$ curl -O https://pixabay.com/en/photos/download/ocean-3605547_1280.jpg</pre>
<p><figure id="attachment_8733" aria-describedby="caption-attachment-8733" style="width: 795px" class="wp-caption alignnone"><img loading="lazy" class="size-full wp-image-8733" src="https://www.osradar.com/wp-content/uploads/2018/12/4-16.png" alt="4.- Downloading a file" width="795" height="149" srcset="https://www.osradar.com/wp-content/uploads/2018/12/4-16.png 795w, https://www.osradar.com/wp-content/uploads/2018/12/4-16-300x56.png 300w, https://www.osradar.com/wp-content/uploads/2018/12/4-16-768x144.png 768w" sizes="(max-width: 795px) 100vw, 795px" /><figcaption id="caption-attachment-8733" class="wp-caption-text">4.- Downloading a file</figcaption></figure></p>
<p>You can use the <code>-o</code> option to specify the name of the downloaded file.</p>
<pre class="">:~$ curl -o image.jpg https://pixabay.com/en/photos/download/ocean-3605547_1280.jpg</pre>
<p><figure id="attachment_8734" aria-describedby="caption-attachment-8734" style="width: 889px" class="wp-caption alignnone"><img loading="lazy" class="size-full wp-image-8734" src="https://www.osradar.com/wp-content/uploads/2018/12/5-15.png" alt="5.- Downloading a file using the -o option" width="889" height="148" srcset="https://www.osradar.com/wp-content/uploads/2018/12/5-15.png 889w, https://www.osradar.com/wp-content/uploads/2018/12/5-15-300x50.png 300w, https://www.osradar.com/wp-content/uploads/2018/12/5-15-768x128.png 768w" sizes="(max-width: 889px) 100vw, 889px" /><figcaption id="caption-attachment-8734" class="wp-caption-text">5.- Downloading a file using the -o option</figcaption></figure></p>
<p>I remind you again that, I&#8217;m using test URLs, you have to enter yours.</p>
<h2>5. Use a proxy</h2>
<p>With CURL it is possible to make connections through a <a href="https://www.osradar.com/squid-proxy-install-and-configure-it/">proxy</a>. The proxy may or may not require authentication.</p>
<pre class="">:~$ curl -x your-proxy:8080 -U user_password -O http://domain.com/file</pre>
<p><figure id="attachment_8736" aria-describedby="caption-attachment-8736" style="width: 1122px" class="wp-caption alignnone"><img loading="lazy" class="size-full wp-image-8736" src="https://www.osradar.com/wp-content/uploads/2018/12/6-66.png" alt="6.- Using a proxy server" width="1122" height="183" srcset="https://www.osradar.com/wp-content/uploads/2018/12/6-66.png 1122w, https://www.osradar.com/wp-content/uploads/2018/12/6-66-300x49.png 300w, https://www.osradar.com/wp-content/uploads/2018/12/6-66-768x125.png 768w, https://www.osradar.com/wp-content/uploads/2018/12/6-66-1024x167.png 1024w, https://www.osradar.com/wp-content/uploads/2018/12/6-66-1068x174.png 1068w" sizes="(max-width: 1122px) 100vw, 1122px" /><figcaption id="caption-attachment-8736" class="wp-caption-text">6.- Using a proxy server</figcaption></figure></p>
<p>In case the proxy server does not need authentication, you can omit the option -U.</p>
<h2>6. Get HTTP header information from a website</h2>
<p>There are occasions when it is necessary to know the information stored in the HTTP headers of some website. It is really easy to do it with CURL.</p>
<pre class="">:~$ curl -I http://website.com</pre>
<p><figure id="attachment_8737" aria-describedby="caption-attachment-8737" style="width: 767px" class="wp-caption alignnone"><img loading="lazy" class="size-full wp-image-8737" src="https://www.osradar.com/wp-content/uploads/2018/12/7-77.png" alt="7.- Showing HTTP website header" width="767" height="206" srcset="https://www.osradar.com/wp-content/uploads/2018/12/7-77.png 767w, https://www.osradar.com/wp-content/uploads/2018/12/7-77-300x81.png 300w" sizes="(max-width: 767px) 100vw, 767px" /><figcaption id="caption-attachment-8737" class="wp-caption-text">7.- Showing HTTP website header</figcaption></figure></p>
<h2>7. Limit download rate</h2>
<p>If you are connected using mobile data or simply want to limit the CURL download rate, you can do it easily.</p>
<pre class="">:~$ curl --limit-rate 100K -O http://domain.com/file.file</pre>
<p><figure id="attachment_8738" aria-describedby="caption-attachment-8738" style="width: 749px" class="wp-caption alignnone"><img loading="lazy" class="size-full wp-image-8738" src="https://www.osradar.com/wp-content/uploads/2018/12/8-88.png" alt="8.- Using a proxy server" width="749" height="155" srcset="https://www.osradar.com/wp-content/uploads/2018/12/8-88.png 749w, https://www.osradar.com/wp-content/uploads/2018/12/8-88-300x62.png 300w" sizes="(max-width: 749px) 100vw, 749px" /><figcaption id="caption-attachment-8738" class="wp-caption-text">8.- Using a proxy server</figcaption></figure></p>
<h2>8. Download file from an FTP server</h2>
<p>As I said at the beginning of this post, CURL supports many protocols, not only HTTP but also <a href="https://www.osradar.com/configure-vsftpd-with-ssl-tls-on-centos-7/">FTP</a>. Now I will show you how to do it.</p>
<pre class="">:~$ curl -u username:password -O ftp://ftpserver/file.zip</pre>
<p><figure id="attachment_8739" aria-describedby="caption-attachment-8739" style="width: 1124px" class="wp-caption alignnone"><img loading="lazy" class="size-full wp-image-8739" src="https://www.osradar.com/wp-content/uploads/2018/12/9-99.png" alt="9.- Downloading a file from a FTP server" width="1124" height="155" srcset="https://www.osradar.com/wp-content/uploads/2018/12/9-99.png 1124w, https://www.osradar.com/wp-content/uploads/2018/12/9-99-300x41.png 300w, https://www.osradar.com/wp-content/uploads/2018/12/9-99-768x106.png 768w, https://www.osradar.com/wp-content/uploads/2018/12/9-99-1024x141.png 1024w, https://www.osradar.com/wp-content/uploads/2018/12/9-99-1068x147.png 1068w" sizes="(max-width: 1124px) 100vw, 1124px" /><figcaption id="caption-attachment-8739" class="wp-caption-text">9.- Downloading a file from an FTP server</figcaption></figure></p>
<p>In case you do not need authentication, omit the option -u.</p>
<h2>9. Upload Files to an FTP server</h2>
<p>You can also upload files to an FTP server. The syntax is similar only this time, you should add the -T option.</p>
<pre class="">:~$ curl -u username:password -T myfilepath.jpg ftp://ftpserver/file.zip</pre>
<p><em>Note: I&#8217;m using false addresses and that&#8217;s why CURL can&#8217;t find them. But don&#8217;t worry that the commands are correct.</em></p>
<h2>10. Check the CURL help</h2>
<p>Of course, the use of the CURL command is very extensive and I only demonstrated some of its uses. For more information about the CURL command, it is convenient to consult its help from the terminal.</p>
<pre class="">:~$ curl --help</pre>
<p><figure id="attachment_8740" aria-describedby="caption-attachment-8740" style="width: 1366px" class="wp-caption alignnone"><img loading="lazy" class="size-full wp-image-8740" src="https://www.osradar.com/wp-content/uploads/2018/12/10-1111.png" alt="10.- CURL help" width="1366" height="768" srcset="https://www.osradar.com/wp-content/uploads/2018/12/10-1111.png 1366w, https://www.osradar.com/wp-content/uploads/2018/12/10-1111-300x169.png 300w, https://www.osradar.com/wp-content/uploads/2018/12/10-1111-768x432.png 768w, https://www.osradar.com/wp-content/uploads/2018/12/10-1111-1024x576.png 1024w, https://www.osradar.com/wp-content/uploads/2018/12/10-1111-1068x600.png 1068w, https://www.osradar.com/wp-content/uploads/2018/12/10-1111-747x420.png 747w" sizes="(max-width: 1366px) 100vw, 1366px" /><figcaption id="caption-attachment-8740" class="wp-caption-text">10.- CURL help</figcaption></figure></p>
<p>And that&#8217;s it.</p>
<h1>Conclusion</h1>
<p>I hope this article has made clear to you the potential of CURL. There is so much potential that there is still so much to show, but I think the objective has been achieved.</p>
<p>CURL is widely used in script automation of content downloads and is not only used in computer equipment but in many others.</p>
<p>So, if you liked the article share it through your social networks.</p>
<p>The post <a rel="nofollow" href="https://www.osradar.com/how-to-use-curl-command-linux/">How to use CURL command on 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-curl-command-linux/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
