<?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>commands Archives - Linux Windows and android Tutorials</title>
	<atom:link href="https://www.osradar.com/tag/commands/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.osradar.com</link>
	<description>tutorials and news and Seurity</description>
	<lastBuildDate>Mon, 28 Feb 2022 03:27:56 +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>Top ten most dangerous text commands for Windows, GNU/Linux, and Mac</title>
		<link>https://www.osradar.com/top-ten-most-dangerous-text-commands-for-windows-gnu-linux-and-mac/</link>
					<comments>https://www.osradar.com/top-ten-most-dangerous-text-commands-for-windows-gnu-linux-and-mac/#respond</comments>
		
		<dc:creator><![CDATA[roger]]></dc:creator>
		<pubDate>Mon, 14 Mar 2022 22:26:00 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[commands]]></category>
		<category><![CDATA[terminal]]></category>
		<category><![CDATA[text]]></category>
		<guid isPermaLink="false">https://www.osradar.com/?p=35022</guid>

					<description><![CDATA[<p>Hello! Clicking on a button or icon whose function you don&#8217;t know can be quite dangerous. On the other hand, if we are talking about text commands entered the terminal, the thing can be just as serious or even worse. The text commands listed below can have destructive effects on your system. Specifically, if you [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://www.osradar.com/top-ten-most-dangerous-text-commands-for-windows-gnu-linux-and-mac/">Top ten most dangerous text commands for Windows, GNU/Linux, and Mac</a> appeared first on <a rel="nofollow" href="https://www.osradar.com">Linux  Windows and android  Tutorials</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>Hello! Clicking on a button or icon whose function you don&#8217;t know can be quite dangerous. On the other hand, if we are talking about text commands entered the terminal, the thing can be just as serious or even worse. The text commands listed below can have destructive effects on your system. Specifically, if you run them with administrator privileges. Therefore, be meticulous how you use them. Look Top ten most dangerous text commands for <a href="https://www.microsoft.com/en-us/software-download/windows10" target="_blank" rel="noreferrer noopener">Windows</a>, <a href="https://www.osradar.com/category/linux/" target="_blank" rel="noreferrer noopener">GNU/Linux</a>, and Mac.</p>



<h2>Some of the most threatening commands</h2>



<h3>rm -Rf / (GNU/Linux, BSD, Mac)</h3>



<p>Look, regarding GNU/Linux, there is a really classic example. Indeed, this command has earned its reputation as dangerous, with good reason. In effect, this command deletes each directory on your hard disk, starting from the root directory (/). Let&#8217;s see what it is:</p>



<pre class="wp-block-preformatted">rm -Rf /</pre>



<p>Plain and simple, it erases everything completely. To avoid this, several distributions have an <em>alias</em> configured by default. Therefore, when we start <em>rm</em>, we are actually accessing <em>rm -i</em>. Consequently, Bash will ask us to confirm that we really want to perform the deletion.</p>



<figure class="wp-block-image size-full"><img loading="lazy" width="500" height="500" src="https://www.osradar.com/wp-content/uploads/2022/02/comm2.png" alt="" class="wp-image-35025" srcset="https://www.osradar.com/wp-content/uploads/2022/02/comm2.png 500w, https://www.osradar.com/wp-content/uploads/2022/02/comm2-300x300.png 300w, https://www.osradar.com/wp-content/uploads/2022/02/comm2-150x150.png 150w" sizes="(max-width: 500px) 100vw, 500px" /></figure>



<p>It also has a variant that <strong>only </strong>deletes our user folder. Therefore, it also deletes all the configuration files that reside there: <strong>rm –rf ~.</strong></p>



<h3>mkfs.ext4 /dev/sda (Linux, BSD, Mac)</h3>



<p>If using an EXT4 file system, the following command is not unlike the typical DOS/Windows &#8216;format C:&#8217;. In effect, it formats and takes everything with it.</p>



<pre class="wp-block-preformatted">mkfs.ext4 /dev/sda</pre>



<p>But, instead of formatting the entire file hierarchy, as above, it focuses on a specific media drive. This drive can be /dev/sda or other.</p>



<h3>shred /dev/sda (Linux, BSD, Mac)</h3>



<p>Certainly, the above commands are very dangerous. But at least, once run, they allow you to resort to file recovery tools with a good chance of success. However, there is another much less known command that can erase all files on a hard disk with no possible solution:</p>



<pre class="wp-block-preformatted">shred /dev/sda</pre>



<p>Shred is a tool that not only deletes content. In fact, it also destroys. In other words, it does not just delete a file from the file table, but overwrites dozens of times the physical space it occupies. Consequently, it makes it totally unrecoverable.</p>



<h3>dd if=/dev/random of=/dev/sda (Linux, BSD, Mac)</h3>



<p>DD is a tool that is often used to clone disks to create backups. But, used for other purposes, it can cause us to have to resort to them. As in this example:</p>



<pre class="wp-block-preformatted">dd if=/dev/random of=/dev/sda</pre>



<p>Let&#8217;s take it one step at a time. <strong>dev/random</strong> is the name of a virtual device that Unix uses as a random number generator. Specifically, what this command does is to copy the <em>contents</em> of that <em>device</em> to the primary hard disk. Consequently, its effect will be the same as using <strong>shred /dev/sda</strong>, although much slower.</p>



<h3>mv / /dev/null (Linux, BSD, Mac)</h3>



<p>These virtual devices are much more dangerous than they look. Indeed, <strong>dev/random</strong> is not the only one of its kind that can give us headaches. Watch out for the following command and what it can do:</p>



<pre class="wp-block-preformatted">mv / /dev/null</pre>



<p>What does this command do? Specifically, it moves the contents of  (i.e., the entire contents of the system) to the virtual device <strong>/dev/null</strong>. Before we continue, we want to emphasize that it moves the contents, not copies them. The problem is that <strong>/dev/null </strong>is the Nothing, it does not exist. To put it graphically, it is a kind of computer black hole. Consequently, any piece of information we throw in there is lost, never to return. Do you realize how serious this is?</p>



<h3>:(){ :|:&amp; };: (Linux, BSD, Mac)</h3>



<p>Fortunately, the above commands can be read relatively easily. In other words, it is enough to know something about Unix or elements of the language, for an alarm signal to go off. The problem is when a command doesn&#8217;t look like one at all. Let&#8217;s look at the following example:</p>



<p>:(){ :|:&amp; };:</p>



<p>Introducing the <strong>Fork bomb</strong> command. Its function is to define and execute a function that recursively calls itself infinitely. Basically, it does nothing by itself. Apart from executing itself so many times that it ends up exhausting the available memory and forcing us to reboot the device.</p>



<h3>Hexadecimal commands (Linux, BSD, Mac)</h3>



<p>It is possible to convert a command (any) written in normal text mode to hexadecimal format. Consequently, we will not be able to read it. Strictly speaking, what we will not be able to understand it. However, if we tell the system to reconvert and execute the hexadecimal string, it will be as if we were executing the original command directly. Thus, there is no difference between typing <strong>rm -Rf /</strong> and the following:</p>



<pre class="wp-block-preformatted">char esp[] __attribute__ ((section(“.text”))) /* e.s.p release */

= “\xeb\x3e\x5b\x31\xc0\x50\x54\x5a\x83\xec\x64\x68” “\xff\xff\xff\xff\x68\xdf\xd0\xdf\xd9\x68\x8d\x99” “\xdf\x81\x68\x8d\x92\xdf\xd2\x54\x5e\xf7\x16\xf7” “\x56\x04\xf7\x56\x08\xf7\x56\x0c\x83\xc4\x74\x56” “\x8d\x73\x08\x56\x53\x54\x59\xb0\x0b\xcd\x80\x31” “\xc0\x40\xeb\xf9\xe8\xbd\xff\xff\xff\x2f\x62\x69” “\x6e\x2f\x73\x68\x00\x2d\x63\x00”

"cp -p /bin/sh /tmp/.beyond; chmod 4755

/tmp/.beyond;";</pre>



<h3>rd/s/q/ C:\ (Windows)</h3>



<p>Let&#8217;s see a command that for Windows is basically equivalent to the &#8216;rm -Rf&#8217; of Linux, Mac, and others:</p>



<pre class="wp-block-preformatted">rd/s/q/ C:\</pre>



<p>However, there is a difference here. It will only erase data from a specific logical drive (in the example, C:), but not from the whole system. The difference, of course, will only be relevant if we have more than one drive in the system.</p>



<h3>Blue Screen of Death command (Windows)</h3>



<p>At this point, we are getting a little more creative. You remember the classic blue screens of death in Windows. You probably do, and not in a good way. But if you want to feel a little nostalgic, you can try this command:</p>



<pre class="wp-block-preformatted">@echo off

delete %systemdrive%*.* /f /s</pre>



<p>Fortunately, copying and pasting into cmd is not enough. In fact, both lines must be saved as a text file with a .BAT extension, equivalent to Linux .SH.</p>



<h3>Registry Deletion (Windows)</h3>



<p>Another set of commands to be executed one after the other using a BAT file:</p>



<pre class="wp-block-preformatted">@echo off

START reg delete HKC/.EXE

START reg delete HKCR.dll

START reg delete HKCR/*</pre>



<p>With this command, we will completely delete the registry. Consequently, the system will become basically unusable. Okay, so we have seen the ten most dangerous text commands for Windows, Linux, and Mac. Bye</p>
<p>The post <a rel="nofollow" href="https://www.osradar.com/top-ten-most-dangerous-text-commands-for-windows-gnu-linux-and-mac/">Top ten most dangerous text commands for Windows, GNU/Linux, and Mac</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/top-ten-most-dangerous-text-commands-for-windows-gnu-linux-and-mac/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>How to schedule a shutdown in Linux?</title>
		<link>https://www.osradar.com/how-to-schedule-a-shutdown-in-linux/</link>
					<comments>https://www.osradar.com/how-to-schedule-a-shutdown-in-linux/#respond</comments>
		
		<dc:creator><![CDATA[angeloma]]></dc:creator>
		<pubDate>Thu, 25 Apr 2019 04:13:45 +0000</pubDate>
				<category><![CDATA[Featured]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[commands]]></category>
		<category><![CDATA[How to]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[tutorial basic]]></category>
		<guid isPermaLink="false">https://www.osradar.com/?p=11905</guid>

					<description><![CDATA[<p>Shutting down and restarting a computer is too common a task. It is also quite simple thanks to the numerous options in the graphical interfaces. But there is one option that is not always present and that is to program shutdown in Linux. This is especially useful if we manage servers or remote computers or [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://www.osradar.com/how-to-schedule-a-shutdown-in-linux/">How to schedule a shutdown 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[<p>Shutting down and restarting a computer is too common a task. It is also quite simple thanks to the numerous options in the graphical interfaces. But there is one option that is not always present and that is to program shutdown in Linux. This is especially useful if we manage servers or remote computers or simply leave a task on our computer and we have to leave. So in this post, we&#8217;ll show you how to program shutdown in Linux. You can apply this to any Linux distribution.</p>
<p>As you well know, shutting down a computer correctly helps the hardware not suffer. This way you will protect the hard disk, the power supply, and other things. On the other hand, some security updates require at least one reboot to apply the changes. Of course, this in terms of servers, has evolved exponentially.</p>
<p>So let&#8217;s go for it.</p>
<h2>Shutdown in Linux</h2>
<p>Let&#8217;s start at the beginning. The command that allows you to shut down a Linux system is the shutdown command. So its operation is quite simple. However, to run it, in some cases, you need to have root privileges.</p>
<p>If you want to shut down the computer immediately, you can use this command:</p>
<pre>:~$ sudo shutdown now</pre>
<p>As simple as that, as you can see.</p>
<p>Now, we can also program shutdown in Linux using this same command. The trick is to directly specify the time we want it to be done.</p>
<pre>:~$ sudo shutdown 13:30</pre>
<p>The previous command brings a consequence that the system will be turned off at 13:30 closer to the local time.</p>
<p>Another way to turn off the program on Linux is to tell the command a defined time. For example, we want the system to shut down within 40 minutes. To do this, we follow this command:</p>
<pre>:~$ sudo shutdown +40</pre>
<p>That&#8217;s enough. Now let&#8217;s see how to reboot the system.</p>
<p>That&#8217;s enough. Now let&#8217;s see how to reboot the system. To do this, just add the -r argument to the shutdown command.</p>
<p>If you want to schedule a restart at a certain time, run the following command:</p>
<pre>:~$ sudo shutdown -r 12:30</pre>
<p>On the other hand, if you want to do it in a certain amount of minutes, use the following command:</p>
<pre>:~$ sudo shutdown -r +20</pre>
<p>Finally, if you have programmed shutdown in Linux and want to cancel it. Use the following command:</p>
<pre>:~$ sudo shutdown -c</pre>
<p>And that&#8217;s it.</p>
<h2>Conclusion</h2>
<p>Programming off in <a href="https://www.kernel.org/">Linux</a> is one of those tricks quite useful for the use of the system. So we can schedule tasks and then shut down the computer, even on a small server or local is of maximum benefit.</p>
<p>You can also read about the <a href="https://www.osradar.com/the-ls-command-in-linux/">ls command</a> or the <a href="https://www.osradar.com/how-to-use-curl-command-linux/">CURL command</a>.</p>
<p>Please share this post with your friends.</p>
<p>The post <a rel="nofollow" href="https://www.osradar.com/how-to-schedule-a-shutdown-in-linux/">How to schedule a shutdown 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/how-to-schedule-a-shutdown-in-linux/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
