<?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>How To Do Everything &#124; How To Tutorials &#187; Linux/Unix</title>
	<atom:link href="http://howtoideas.net/category/computer-and-programming/linux-unix/feed" rel="self" type="application/rss+xml" />
	<link>http://howtoideas.net</link>
	<description>How To Ideas</description>
	<lastBuildDate>Wed, 25 Apr 2012 21:22:25 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
		<item>
		<title>How to install Wine in Ubuntu</title>
		<link>http://howtoideas.net/install-wine-ubuntu</link>
		<comments>http://howtoideas.net/install-wine-ubuntu#comments</comments>
		<pubDate>Mon, 16 Jan 2012 16:17:12 +0000</pubDate>
		<dc:creator>Rohit</dc:creator>
				<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[install wine]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[ubuntu 11.10]]></category>
		<category><![CDATA[Unix]]></category>
		<category><![CDATA[WINE]]></category>
		<category><![CDATA[wine software]]></category>
		<category><![CDATA[wine1.3]]></category>

		<guid isPermaLink="false">http://howtoideas.net/?p=3360</guid>
		<description><![CDATA[Wine is free and open source application for Unix / Linux based Operating Systems which allows us to run applications written for Microsoft Windows. WINE is an acronym for WINdows Emulator. WINE also provides a software library, Winelib, which developers can use to compile Windows applications to port them to Unix / Linux based systems. In this tutorial, I will show you how to install Wine in Ubuntu using both... <span class="meta-more"><a href="http://howtoideas.net/install-wine-ubuntu">Read more &#187;</a></span>]]></description>
				<content:encoded><![CDATA[<p><a href="http://www.winehq.org/" target="_blank"><strong>Wine</strong></a> is free and open source application for <strong>Unix / Linux</strong> based <strong>Operating Systems</strong> which allows us to run applications written for <strong>Microsoft Windows</strong>. WINE is an acronym for <em>WIN</em>dows <em>E</em>mulator. <strong>WINE</strong> also provides a software library, <strong>Winelib</strong>, which developers can use to compile <strong>Windows</strong> applications to port them to <strong>Unix / Linux</strong> based systems.</p>
<p>In this tutorial, I will show you how to install <strong>Wine</strong> in <strong>Ubuntu</strong> using both methods <strong>1. Using Terminal </strong>and<strong> 2. Manual Installation</strong>. Following method is successfully tested on <strong>Ubuntu 11.10.</strong></p>
<p><span style="text-decoration: underline;"><strong>Installing using Terminal:<br />
</strong></span></p>
<ol>
<li>Start by adding repository for <strong>Wine</strong> (<code>ppa:ubuntu-wine/ppa</code>) to your <strong>Software Sources</strong> using following command.
<pre name="code" class="bash">sudo add-apt-repository ppa:ubuntu-wine/ppa</pre>
<p><div id="attachment_3362" class="wp-caption aligncenter" style="width: 589px"><a href="http://howtoideas.net/install-wine-ubuntu/add-repository" rel="attachment wp-att-3362"><img class=" wp-image-3362 " title="Add Repository" src="http://howtoideas.net/wp-content/uploads/2012/01/Add-Repository.png" alt="Add Repository" width="579" height="327" /></a><p class="wp-caption-text">Add Repository</p></div></li>
<li>Now get updates for this repository&#8217;s packages using following command.
<pre name="code" class="bash">sudo apt-get update</pre>
<p><div id="attachment_3364" class="wp-caption aligncenter" style="width: 528px"><a href="http://howtoideas.net/install-wine-ubuntu/get-updates-2" rel="attachment wp-att-3364"><img class=" wp-image-3364 " title="Get Updates" src="http://howtoideas.net/wp-content/uploads/2012/01/Get-Updates.png" alt="Get Updates" width="518" height="371" /></a><p class="wp-caption-text">Get Updates</p></div></li>
<li>Now install the Wine using the following command.
<pre name="code" class="bash">sudo apt-get install wine1.3</pre>
<div id="attachment_3365" class="wp-caption aligncenter" style="width: 582px"><a href="http://howtoideas.net/install-wine-ubuntu/installing-wine-1-3" rel="attachment wp-att-3365"><img class=" wp-image-3365 " title="Installing Wine 1.3" src="http://howtoideas.net/wp-content/uploads/2012/01/Installing-Wine-1.3.png" alt="Installing Wine 1.3" width="572" height="386" /></a><p class="wp-caption-text">Installing Wine 1.3</p></div>
<p>It will install <strong>Wine1.3</strong>, If you want to install other version just replace <code>wine1.3</code> with <code>wine[version-number]</code>.</li>
</ol>
<p><span style="text-decoration: underline;"><strong>Installing Manually</strong></span><strong>:</strong></p>
<ol>
<li>Open <strong>Software Sources</strong> by searching the same in <strong>Dash Home</strong> in <strong>Ubuntu 11.10</strong> or by navigating to <strong>Applications-&gt;Ubuntu Software Center</strong> and then selecting <strong>Edit-&gt;Software Sources</strong> in lower versions of Ubuntu.
<p><div id="attachment_3366" class="wp-caption aligncenter" style="width: 530px"><a href="http://howtoideas.net/install-wine-ubuntu/software-sources" rel="attachment wp-att-3366"><img class=" wp-image-3366 " title="Software Sources" src="http://howtoideas.net/wp-content/uploads/2012/01/Software-Sources.png" alt="Software Sources" width="520" height="209" /></a><p class="wp-caption-text">Software Sources</p></div></li>
<li>In <strong>Software Sources</strong> dialogue box, click on the <strong>Other Software</strong> tab and then click on <strong>Add</strong> button. Then copy and paste following line in the dialogue box opened and click on <strong>Add Source</strong> to add <strong>Wine</strong> repository.<br />
ppa:ubuntu-wine/ppa</p>
<p><div id="attachment_3363" class="wp-caption aligncenter" style="width: 493px"><a href="http://howtoideas.net/install-wine-ubuntu/add-repository-using-software-sources" rel="attachment wp-att-3363"><img class=" wp-image-3363 " title="Add Repository using Software Sources" src="http://howtoideas.net/wp-content/uploads/2012/01/Add-Repository-using-Software-Sources.png" alt="Add Repository using Software Sources" width="483" height="451" /></a><p class="wp-caption-text">Add Repository</p></div></li>
<li>Now open following link in your browser. It will open up <strong>Ubuntu Software Center</strong>. Follow the instructions given to install <strong>Wine</strong> in your PC.<br />
<blockquote><p><code>apt://wine1.3</code></p></blockquote>
<p>Replace version number with the one you want to install.</p>
<p><div id="attachment_3367" class="wp-caption aligncenter" style="width: 400px"><a href="http://howtoideas.net/install-wine-ubuntu/install-wine1-3" rel="attachment wp-att-3367"><img class=" wp-image-3367 " title="Install Wine1.3" src="http://howtoideas.net/wp-content/uploads/2012/01/Install-Wine1.3.png" alt="Install Wine1.3" width="390" height="465" /></a><p class="wp-caption-text">Install Wine1.3</p></div></li>
</ol>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://howtoideas.net/install-wine-ubuntu/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to install Eclipse in Linux</title>
		<link>http://howtoideas.net/install-eclipse-linux</link>
		<comments>http://howtoideas.net/install-eclipse-linux#comments</comments>
		<pubDate>Sun, 15 Jan 2012 16:16:54 +0000</pubDate>
		<dc:creator>Rohit</dc:creator>
				<category><![CDATA[Eclipse]]></category>
		<category><![CDATA[Linux/Unix]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[3.7]]></category>
		<category><![CDATA[3.7.1]]></category>
		<category><![CDATA[eclipse]]></category>
		<category><![CDATA[install]]></category>
		<category><![CDATA[install eclipse]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[ubuntu 11.10]]></category>
		<category><![CDATA[Unix]]></category>

		<guid isPermaLink="false">http://howtoideas.net/?p=3349</guid>
		<description><![CDATA[Eclipse is a an IDE i.e Integrated Development Environment tool mostly used by developers for JAVA development. This tool support development in a number of languages like C, C++, COBOL, Java, Perl, PHP, Python, Ruby, etc. and also supports plugins which can let you develop projects in a number of other languages as well. Eclipse SDK is free and open source software released under the terms of the Eclipse Public License.... <span class="meta-more"><a href="http://howtoideas.net/install-eclipse-linux">Read more &#187;</a></span>]]></description>
				<content:encoded><![CDATA[<p><strong>Eclipse</strong> is a an <strong>IDE</strong> i.e <strong>Integrated Development Environment</strong> tool mostly used by developers for <strong>JAVA</strong> development. This tool support development in a number of languages like C, C++, COBOL, Java, Perl, PHP, Python, Ruby, etc. and also supports plugins which can let you develop projects in a number of other languages as well.</p>
<p>Eclipse SDK is free and open source software released under the terms of the <strong>Eclipse Public License.</strong> In this tutorial, I will explain you how to install this IDE in your Linux based system. All the steps are successfully tested on <strong>Ubuntu 11.10</strong> and <strong>Eclipse 3.7.1</strong>.</p>
<p><span style="text-decoration: underline;"><strong>Instructions:</strong></span></p>
<ol>
<li>Download <a href="http://www.eclipse.org/downloads/" target="_blank">Eclipse</a> package from their website. You must select a version according to your need like if you want to develop C/C++ applications then you must select <strong>Eclipse IDE for C/C++ Developers</strong>, if you want to develop applications if JAVA, then you must select <strong>Eclipse IDE for JAVA Developers</strong> or <strong>Eclipse IDE for JAVA EE Developers</strong> and if you want to develop applications in third-party languages like <strong>Android</strong> from <strong>Google</strong> or some other language plugins, then you must select <strong>Eclipse Classic</strong>.</li>
<li>Now open your <strong>Terminal</strong> application, move to the directory where you have downloaded eclipse archive using <code>cd</code> command and extract the package downloaded using the <code>tar</code> command. In my case the command is as follows
<pre name="code" class="c">tar xzf eclipse-SDK-3.7.1-linux-gtk.tar.gz</pre>
<div id="attachment_3353" class="wp-caption aligncenter" style="width: 548px"><a href="http://howtoideas.net/install-eclipse-linux/extract-eclipse" rel="attachment wp-att-3353"><img class=" wp-image-3353 " title="Extract Eclipse" src="http://howtoideas.net/wp-content/uploads/2012/01/Extract-Eclipse.png" alt="Extract Eclipse" width="538" height="152" /></a><p class="wp-caption-text">Extract Eclipse</p></div>
<p>Change the name of file <code>eclipse-SDK-3.7.1-linux-gtk.tar.gz</code> with the one you just downloaded.</li>
<li>You can also extract the package by right clicking and then selecting <strong>Extract Here</strong>.</li>
<li>After extracting, move the extracted directory to <code>/opt/ directory/</code>. After that change the owner of the directory to <code>root</code> using <code>chown</code> command recursively (by using <code>-R</code> option with <code>chown</code> command) and then add read permission to all the directories and files present in the <strong>Eclipse</strong> directory by using <code>chmod</code> command with <code>-R</code> option.
<pre name="code" class="c">sudo mv eclipse /opt/
sudo chown -R root:root eclipse
sudo chmod -R +r eclipse</pre>
<div id="attachment_3354" class="wp-caption aligncenter" style="width: 527px"><a href="http://howtoideas.net/install-eclipse-linux/move-eclipse-to-opt" rel="attachment wp-att-3354"><img class=" wp-image-3354 " title="Move Eclipse to /opt/ Directory" src="http://howtoideas.net/wp-content/uploads/2012/01/Move-Eclipse-to-opt.png" alt="Move Eclipse to /opt/ Directory" width="517" height="155" /></a><p class="wp-caption-text">Move Eclipse to /opt/ Directory</p></div>
<p><div id="attachment_3350" class="wp-caption aligncenter" style="width: 487px"><a href="http://howtoideas.net/install-eclipse-linux/change-permissions-and-directory-owner" rel="attachment wp-att-3350"><img class=" wp-image-3350 " title="Change Permissions and Directory Owner" src="http://howtoideas.net/wp-content/uploads/2012/01/Change-Permissions-and-Directory-Owner.png" alt="Change Permissions and Directory Owner" width="477" height="67" /></a><p class="wp-caption-text">Change Permissions and Directory Owner</p></div></li>
<li>Now we need to create eclipse executable in <code>/usr/bin/</code> directory with following commands and then we need to set its permissions to <code>755</code>. Use the following command to create eclipse executable
<pre name="code" class="c">sudo gedit /usr/bin/eclipse</pre>
<p>Now place following command lines in the file opened in <code>gedit</code></p>
<pre name="code" class="c">#!/bin/sh
#export MOZILLA_FIVE_HOME="/usr/lib/mozilla/"
export ECLIPSE_HOME="/opt/eclipse"
$ECLIPSE_HOME/eclipse $*</pre>
<p>After this use the following command to change executable file permission to <code>755</code></p>
<pre name="code" class="c">sudo chmod 755 /usr/bin/eclipse</pre>
<p><div id="attachment_3352" class="wp-caption aligncenter" style="width: 589px"><a href="http://howtoideas.net/install-eclipse-linux/creating-eclipse-executable" rel="attachment wp-att-3352"><img class=" wp-image-3352 " title="Creating Eclipse Executable" src="http://howtoideas.net/wp-content/uploads/2012/01/Creating-Eclipse-Executable.png" alt="Creating Eclipse Executable" width="579" height="369" /></a><p class="wp-caption-text">Creating Eclipse Executable</p></div></li>
<li>Now we need to create <strong>Gnome menu item</strong> for eclipse. Use the following command to create <code>eclipse.desktop</code> file in <code>/usr/share/applications/</code> directory
<pre name="code" class="c">sudo gedit /usr/share/applications/eclipse.desktop</pre>
<p>Paste in the following lines in that file and then save and quit <code>gedit</code></p>
<pre name="code" class="c">[Desktop Entry]
Encoding=UTF-8
Name=Eclipse
Comment=Eclipse IDE
Exec=eclipse
Icon=/opt/eclipse/icon.xpm
Terminal=false
Type=Application
Categories=GNOME;Application;Development;
StartupNotify=true</pre>
<p><div id="attachment_3351" class="wp-caption aligncenter" style="width: 589px"><a href="http://howtoideas.net/install-eclipse-linux/create-gnome-menu-item" rel="attachment wp-att-3351"><img class=" wp-image-3351 " title="Create Gnome Menu Item" src="http://howtoideas.net/wp-content/uploads/2012/01/Create-Gnome-Menu-Item.png" alt="Create Gnome Menu Item" width="579" height="400" /></a><p class="wp-caption-text">Create Gnome Menu Item</p></div></li>
<li>That&#8217;s all Eclipse is successfully installed in your system. You can launch it from command line using the following command
<pre name="code" class="c">/opt/eclipse/eclipse -clean &amp;</pre>
</li>
</ol>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://howtoideas.net/install-eclipse-linux/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>How to install or update Firefox in Linux using Terminal</title>
		<link>http://howtoideas.net/install-update-firefox-linux-using-terminal</link>
		<comments>http://howtoideas.net/install-update-firefox-linux-using-terminal#comments</comments>
		<pubDate>Sat, 14 Jan 2012 11:53:13 +0000</pubDate>
		<dc:creator>Rohit</dc:creator>
				<category><![CDATA[Firefox]]></category>
		<category><![CDATA[Linux/Unix]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[firefox]]></category>
		<category><![CDATA[firefox 10.0]]></category>
		<category><![CDATA[instal firefox linux]]></category>
		<category><![CDATA[install]]></category>
		<category><![CDATA[install firefox in ubuntu]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Unix]]></category>

		<guid isPermaLink="false">http://howtoideas.net/?p=3339</guid>
		<description><![CDATA[In this tutorial, I will show you how can you install or update latest version of Firefox in Linux using Terminal commands. Method explained is tested on Ubuntu 11.10 to install Firefox 10.0 and it probably work on all the Linux based Operating Systems. If you already have older version of Firefox installed in your system, then it should not be running while getting this update. If you are not... <span class="meta-more"><a href="http://howtoideas.net/install-update-firefox-linux-using-terminal">Read more &#187;</a></span>]]></description>
				<content:encoded><![CDATA[<p>In this tutorial, I will show you how can you install or update latest version of <strong>Firefox</strong> in <strong>Linux</strong> using <strong>Terminal</strong> commands. Method explained is tested on <strong>Ubuntu 11.10</strong> to install <strong>Firefox 10.0</strong> and it probably work on all the <strong>Linux</strong> based <strong>Operating Systems</strong>.</p>
<p>If you already have older version of Firefox installed in your system, then it should not be running while getting this update. If you are not sure whether latest version is available or not, you can check for the latest version at <a href="http://www.mozilla.org/firefox/" target="_blank">Firefox</a> website.</p>
<p><span style="text-decoration: underline;"><strong>Instructions:</strong></span></p>
<ol>
<li>To start getting latest version of <strong>Firefox</strong> in you system, you should add required repository in your system. Following command let you do that.<br />
<blockquote><pre name="code" class="bash">sudo add-apt-repository ppa:mozillateam/firefox-next</pre>
</blockquote>
<p>When your <strong>Terminal</strong> ask you to press <strong>Enter</strong> as shown in following image, just press <strong>Enter</strong>to continue adding required repository. This command will add the PPA repositories inside your <code>/etc/apt/sources.list.d/</code> directory, in a file named <code>mozillateam-firefox-next-oneiric.list</code>.</p>
<p><div id="attachment_3340" class="wp-caption aligncenter" style="width: 589px"><a href="http://howtoideas.net/install-update-firefox-linux-using-terminal/add-repository-2" rel="attachment wp-att-3340"><img class=" wp-image-3340 " title="Adding Repository - Install Firefox" src="http://howtoideas.net/wp-content/uploads/2012/01/Add-Repository-2.png" alt="Adding Repository - Install Firefox" width="579" height="222" /></a><p class="wp-caption-text">Adding Repository</p></div></li>
<li>After adding repository, its time to get updates. Using following command will get all the updates required.<br />
<blockquote><pre name="code" class="bash">sudo apt-get update</pre>
</blockquote>
<p><div id="attachment_3341" class="wp-caption aligncenter" style="width: 542px"><a href="http://howtoideas.net/install-update-firefox-linux-using-terminal/get-updates" rel="attachment wp-att-3341"><img class=" wp-image-3341 " title="Get Updates - Install Firefox" src="http://howtoideas.net/wp-content/uploads/2012/01/Get-updates.png" alt="Get Updates - Install Firefox" width="532" height="371" /></a><p class="wp-caption-text">Get Updates</p></div></li>
<li>After getting all the updates, its time to finally install latest <strong>Firefox</strong> in your system. Use the following command to install Firefox in your system.<br />
<blockquote><pre name="code" class="bash">sudo apt-get install firefox</pre>
</blockquote>
</li>
<li>This command will show you all the packages which will be installed, which will be upgraded and which ones are no longer required and finally ask you whether you want to continue installation or not. If you are sure that you want to update Firefox or install it, then press <code>'y'</code> or <code>'Y'</code> and hit Enter to continue installation.
<p><div id="attachment_3342" class="wp-caption aligncenter" style="width: 589px"><a href="http://howtoideas.net/install-update-firefox-linux-using-terminal/install-firefox" rel="attachment wp-att-3342"><img class=" wp-image-3342 " title="Installing Firefox" src="http://howtoideas.net/wp-content/uploads/2012/01/Install-Firefox.png" alt="Installing Firefox" width="579" height="371" /></a><p class="wp-caption-text">Installing Firefox</p></div></li>
<li>This which will take a little bit of time (depending on your Internet connection) in downloading the installation package and then finally install them.</li>
</ol>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://howtoideas.net/install-update-firefox-linux-using-terminal/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to create a Terminal Clock using Shell Script</title>
		<link>http://howtoideas.net/create-terminal-clock-shell-script</link>
		<comments>http://howtoideas.net/create-terminal-clock-shell-script#comments</comments>
		<pubDate>Wed, 11 Jan 2012 17:42:21 +0000</pubDate>
		<dc:creator>Rohit</dc:creator>
				<category><![CDATA[Shell Scripting]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[clock]]></category>
		<category><![CDATA[command line]]></category>
		<category><![CDATA[shell]]></category>
		<category><![CDATA[shell script]]></category>
		<category><![CDATA[Terminal]]></category>
		<category><![CDATA[Terminal Clock]]></category>

		<guid isPermaLink="false">http://howtoideas.net/?p=3303</guid>
		<description><![CDATA[date command displays current date and time to the Terminal and we can use this command to recursively display time every second on Terminal which will look like a Terminal Clock. In this tutorial, I will show you how to create a Shell Script which will make the terminal to show system time every second like a clock. Default output of date command prints result in the format shown in... <span class="meta-more"><a href="http://howtoideas.net/create-terminal-clock-shell-script">Read more &#187;</a></span>]]></description>
				<content:encoded><![CDATA[<p><code>date</code> command displays current date and time to the <strong>Terminal</strong> and we can use this command to recursively display time every second on <strong>Terminal</strong> which will look like a <strong>Terminal Clock</strong>. In this tutorial, I will show you how to create a <strong>Shell Script</strong> which will make the terminal to show system time every second like a clock.</p>
<p>Default output of <code>date</code> command prints result in the format shown in following image.</p>
<div id="attachment_3304" class="wp-caption aligncenter" style="width: 390px"><a href="http://howtoideas.net/create-terminal-clock-shell-script/date-command" rel="attachment wp-att-3304"><img class="size-full wp-image-3304" title="date command" src="http://howtoideas.net/wp-content/uploads/2012/01/date-command.png" alt="date command" width="380" height="104" /></a><p class="wp-caption-text">date command</p></div>
<p>But if we use <code>+%r</code> option with <code>date</code> command, the output format changes to format of the system locale as shown in following image.</p>
<div id="attachment_3309" class="wp-caption aligncenter" style="width: 395px"><a href="http://howtoideas.net/create-terminal-clock-shell-script/date-command-to-show-time-in-system-locale-timeformat" rel="attachment wp-att-3309"><img class="size-full wp-image-3309" title="date command to show time in the format of the system locale" src="http://howtoideas.net/wp-content/uploads/2012/01/date-command-to-show-time-in-system-locale-timeformat.png" alt="date command to show time in the format of the system locale" width="385" height="104" /></a><p class="wp-caption-text">date command to show time in the format of the system locale</p></div>
<p><span style="text-decoration: underline;"><strong>Instructions:</strong></span></p>
<ol>
<li>Tell the <strong>Terminal</strong> to use <code>bash</code> to execute the commands of the script file.<br />
<blockquote><pre name="code" class="bash">#!/bin/bash</pre>
</blockquote>
</li>
<li>Now clear the Terminal using <code>clear</code> command so that output of the <code>date</code> command will shown at the top of the Terminal window.<br />
<blockquote><pre name="code" class="bash">clear</pre>
</blockquote>
</li>
<li>Now using a <code>while</code> loop which will run infinitely print the time using the following command in which <code>echo</code> command is used with <code>-e</code> option which enable interpretation of backslash escapes (<code>\b</code>) and <code>\c</code> option prevent the <code>echo</code> command to enter a newline character.<br />
<blockquote><pre name="code" class="bash">echo -e "\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b`date +%r` \c"</pre>
</blockquote>
</li>
<li>We have to sleep the <strong>Shell</strong> for a second before next iteration of <code>while</code> loop takes place. So, the full while loop looks like<br />
<blockquote><pre name="code" class="bash">while true
do
    echo -e "\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b`date +%r` \c"
    sleep 1
done</pre>
</blockquote>
</li>
</ol>
<p>Following image is a screenshot of the working sample script.</p>
<div id="attachment_3306" class="wp-caption aligncenter" style="width: 261px"><a href="http://howtoideas.net/create-terminal-clock-shell-script/terminal-clock-output" rel="attachment wp-att-3306"><img class="size-full wp-image-3306" title="Terminal Clock Output" src="http://howtoideas.net/wp-content/uploads/2012/01/Terminal-Clock-Output.png" alt="Terminal Clock Output" width="251" height="60" /></a><p class="wp-caption-text">Terminal Clock Output</p></div>
<p>You can download the sample script file <a href="http://howtoideas.net/wp-content/uploads/Shell Commands/clock">here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://howtoideas.net/create-terminal-clock-shell-script/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to find Average of Numbers provided through Command Line using Shell Script</title>
		<link>http://howtoideas.net/average-shell-script</link>
		<comments>http://howtoideas.net/average-shell-script#comments</comments>
		<pubDate>Tue, 03 Jan 2012 17:28:02 +0000</pubDate>
		<dc:creator>Rohit</dc:creator>
				<category><![CDATA[Shell Scripting]]></category>
		<category><![CDATA[average]]></category>
		<category><![CDATA[average of numbers]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[command line]]></category>
		<category><![CDATA[find average]]></category>
		<category><![CDATA[how]]></category>
		<category><![CDATA[script]]></category>
		<category><![CDATA[sheel]]></category>
		<category><![CDATA[shell script]]></category>
		<category><![CDATA[Terminal]]></category>
		<category><![CDATA[to]]></category>

		<guid isPermaLink="false">http://howtoideas.net/?p=3130</guid>
		<description><![CDATA[In this tutorial, I will show you how to use Shell Script to find Average of any number of arguments (numbers) provided through Command Line. The script will find show an error if no argument is provided, otherwise it will find Average of numbers provided and prints its output on the Terminal. Algorithm: Check if the numbers of arguments supplied are equal to 0 or not. If yes, print error message... <span class="meta-more"><a href="http://howtoideas.net/average-shell-script">Read more &#187;</a></span>]]></description>
				<content:encoded><![CDATA[<p>In this tutorial, I will show you how to use <strong>Shell Script</strong> to find <strong>Average</strong> of any number of arguments (numbers) provided through <strong>Command Line</strong>. The script will find show an error if no argument is provided, otherwise it will find <strong>Average</strong> of numbers provided and prints its output on the <strong>Terminal</strong>.</p>
<p><span style="text-decoration: underline;"><strong>Algorithm:</strong></span></p>
<ol>
<li>Check if the numbers of arguments supplied are equal to 0 or not. If yes, print error message and exit the script, otherwise move to step 2.</li>
<li>Find sum of all the numbers provided and store the result in variable <code>total</code>.</li>
<li>Now divide the variable <code>total</code> by number of arguments supplied which is the average of numbers provided.</li>
</ol>
<p><span style="text-decoration: underline;"><strong>Instructions:</strong></span></p>
<ol>
<li>Tell the <strong>Terminal</strong> to use <code>bash</code> as <em>shell</em> to execute the script using following line of code.<br />
<blockquote>
<pre name="code" class="bash">#!/bin/bash</pre>
</blockquote>
</li>
<li>Now create three variables <code>total</code>, <code>average</code> and <code>number</code>. <code>total</code> variable to store sum of all the numbers, <code>average</code> to store average of all the numbers and <code>number</code> to store total number of arguments supplied. Initialize <code>total</code> and <code>average</code> to 0 and <code>number</code> to number of arguments supplied.<br />
<blockquote>
<pre name="code" class="bash">total=0
average=0
number=$#</pre>
</blockquote>
</li>
<li>Now check if number of arguments supplied are equal to 0 or not, if yes then print an error message and exit the program.<br />
<blockquote>
<pre name="code" class="bash">if [ $# -eq 0 ]
then
    echo "Usage: $0"
    echo "At least one argument required"
    echo "Example $0 number1 number2 ..."
    exit 1
fi</pre>
</blockquote>
</li>
<li>Now using for loop, loop through all the variables provided and find sum of all the numbers supplied using the following code.<br />
<blockquote>
<pre name="code" class="bash">for temp in $*
do
    total=`expr $total + $temp`
done</pre>
</blockquote>
</li>
<li>Now find average by dividing the variable <code>total</code> by variable <code>number</code> and finally print the result.<br />
<blockquote>
<pre name="code" class="bash">average=`expr $total / $number`
echo "Average of all the numbers is $average"</pre>
</blockquote>
</li>
</ol>
<p>Here are some screenshots of the sample code.</p>
<div id="attachment_3131" class="wp-caption aligncenter" style="width: 403px"><a href="http://howtoideas.net/average-shell-script/find-average" rel="attachment wp-att-3131"><img class="size-full wp-image-3131" title="Find Average Using Shell Script" src="http://howtoideas.net/wp-content/uploads/2012/01/Find-average.png" alt="Find Average Using Shell Script" width="393" height="132" /></a><p class="wp-caption-text">Find Average Using Shell Script</p></div>
<div id="attachment_3133" class="wp-caption aligncenter" style="width: 504px"><a href="http://howtoideas.net/average-shell-script/find-average2" rel="attachment wp-att-3133"><img class="size-full wp-image-3133" title="Find Average Using Shell Script" src="http://howtoideas.net/wp-content/uploads/2012/01/Find-Average2.png" alt="Find Average Using Shell Script" width="494" height="96" /></a><p class="wp-caption-text">Find Average Using Shell Script</p></div>
<div id="attachment_3132" class="wp-caption aligncenter" style="width: 415px"><a href="http://howtoideas.net/average-shell-script/find-average1" rel="attachment wp-att-3132"><img class="size-full wp-image-3132" title="Find Average Using Shell Script" src="http://howtoideas.net/wp-content/uploads/2012/01/Find-Average1.png" alt="Find Average Using Shell Script" width="405" height="94" /></a><p class="wp-caption-text">Find Average Using Shell Script</p></div>
<p>You can download the sample script from <a href="http://howtoideas.net//wp-content/uploads/Shell Commands/average">here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://howtoideas.net/average-shell-script/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to check for leap year in Shell Script</title>
		<link>http://howtoideas.net/how-to-check-for-leap-year-in-shell-script</link>
		<comments>http://howtoideas.net/how-to-check-for-leap-year-in-shell-script#comments</comments>
		<pubDate>Fri, 23 Dec 2011 12:04:54 +0000</pubDate>
		<dc:creator>Rohit</dc:creator>
				<category><![CDATA[Shell Scripting]]></category>
		<category><![CDATA[check leap year]]></category>
		<category><![CDATA[how]]></category>
		<category><![CDATA[leap year]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[script]]></category>
		<category><![CDATA[shell]]></category>
		<category><![CDATA[to]]></category>
		<category><![CDATA[Unix]]></category>

		<guid isPermaLink="false">http://howtoideas.net/?p=3015</guid>
		<description><![CDATA[In this tutorial, I will show you a simple shell script to check whether a given number provided through command line denotes a leap year or not using shell script. Algorithm is fairly simple Check whether the number of command line arguments are equal to 1 or not If not equal to 1, then print an error message and exit, otherwise proceed to next step. Store the value of the... <span class="meta-more"><a href="http://howtoideas.net/how-to-check-for-leap-year-in-shell-script">Read more &#187;</a></span>]]></description>
				<content:encoded><![CDATA[<p>In this tutorial, I will show you a simple shell script to check whether a given number provided through command line denotes a <strong>leap year</strong> or not using <strong>shell script</strong>. Algorithm is fairly simple</p>
<ol>
<li>Check whether the number of command line arguments are equal to 1 or not</li>
<li>If not equal to 1, then print an error message and exit, otherwise proceed to next step.</li>
<li>Store the value of the remainder by dividing number provided through terminal by 4. i.e <code>check=`expr $1 % 4`</code></li>
<li>Now check whether the value of this <code>check</code> variable is equal to 0 or not. If it is equal to 0 then provided number is a leap year, otherwise not.</li>
</ol>
<p><span style="text-decoration: underline;"><strong>Instructions:</strong></span></p>
<ol>
<li>Tell the terminal to user bash shell to execute the program using the following line of code.<br />
<blockquote>
<pre>#!/bin/bash</pre>
</blockquote>
</li>
<li>Now check whether the number of arguments supplied are equal to 1 or not. If not, then print an error message and exit.<br />
<blockquote>
<pre>if [ $# -ne 1 ]
then
    echo "Usage : $0"
    echo "Script to check whether a year is leap year or not"
    echo "Enter a single year to check"
    exit 1
fi</pre>
</blockquote>
</li>
<li>Now assign the remainder of number supplied divided by 4 to a variable named <code>check</code>.<br />
<blockquote>
<pre>check=`expr $1 % 4`</pre>
</blockquote>
</li>
<li>Now check whether the value of this variable <code>check</code> is equal to 0 or not, if it is then the number supplied is a leap year, otherwise not.<br />
<blockquote>
<pre>if [ $check -ne 0 ]
then
    echo "$1 is not a leap year"
else
    echo "$1 is a leap year"
fi</pre>
</blockquote>
</li>
</ol>
<p>Here is a screenshot of the working of this script.</p>
<div id="attachment_3016" class="wp-caption aligncenter" style="width: 487px"><a href="http://howtoideas.net/how-to-check-for-leap-year-in-shell-script/leapyear" rel="attachment wp-att-3016"><img class="size-full wp-image-3016" title="Check Leap Year using Shell Script" src="http://howtoideas.net/wp-content/uploads/2011/12/leapyear.png" alt="Check Leap Year using Shell Script" width="477" height="267" /></a><p class="wp-caption-text">Check Leap Year using Shell Script</p></div>
<p>You can download the sample script from <a href="http://howtoideas.net/wp-content/uploads/Shell Commands/leapyear">here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://howtoideas.net/how-to-check-for-leap-year-in-shell-script/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>The who command &#8211; Terminal</title>
		<link>http://howtoideas.net/the-who-command-terminal</link>
		<comments>http://howtoideas.net/the-who-command-terminal#comments</comments>
		<pubDate>Tue, 20 Dec 2011 22:24:25 +0000</pubDate>
		<dc:creator>Rohit</dc:creator>
				<category><![CDATA[Unix Terminal]]></category>
		<category><![CDATA[command]]></category>
		<category><![CDATA[how]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Terminal]]></category>
		<category><![CDATA[to]]></category>
		<category><![CDATA[Unix]]></category>
		<category><![CDATA[user information]]></category>
		<category><![CDATA[who]]></category>
		<category><![CDATA[who command]]></category>

		<guid isPermaLink="false">http://howtoideas.net/?p=3002</guid>
		<description><![CDATA[who is command or tool in Unix/Linux-based operating systems which enables the user to know who is currently logged in their system i.e who is on the System. If no option is supplied to this command, it will display the names of users currently logged in the system, along with their terminal, the time of login and the host from which they have logged in. *** Note all the following... <span class="meta-more"><a href="http://howtoideas.net/the-who-command-terminal">Read more &#187;</a></span>]]></description>
				<content:encoded><![CDATA[<p><code>who</code> is command or tool in Unix/Linux-based operating systems which enables the user to know who is currently logged in their system i.e who is on the System. If no option is supplied to this command, it will display the names of users currently logged in the system, along with their terminal, the time of login and the host from which they have logged in.</p>
<p><em>*** Note all the following information is tested on Ubuntu 11.10. We endeavor to keep the information up-to-date and correct, However, we cannot guarantee that information given on the site is accurate or up to date</em>.</p>
<p><strong>Syntax </strong> :  <strong>who </strong><em>[options] [file]</em></p>
<p>Here <em>file</em> specify a path name of a file which can be supplied to give additional information. Default one is <em>/etc/utmp</em>.</p>
<p><strong>General Output format :</strong> name [state] line time [idle] [pid] [comment]<em></em></p>
<blockquote>
<ul>
<li><em>name</em> is user&#8217;s login name</li>
<li><em>state</em> shows the user&#8217;s capability of writing to the terminal</li>
<li><em>line</em> is name of the line found in <em>/dev</em></li>
<li><em>time</em> is time since user&#8217;s login</li>
<li><em>idle</em> is time elapsed since the user&#8217;s last activity and . for this means currently the user is using the system i.e not idle</li>
<li><em>pid</em> is user&#8217;s process id</li>
<li><em>comment</em> comment line in inittab.</li>
</ul>
</blockquote>
<p>Following table shows all the available <em>Options</em> which you can use with <code>who</code> command/tool.</p>
<table width="100%" cellspacing="0" cellpadding="4">
<colgroup>
<col width="128*" />
<col width="128*" /></colgroup>
<tbody>
<tr valign="TOP">
<td style="border-width: 1px medium 1px 1px; border-style: solid none solid solid; border-color: #000000 -moz-use-text-color #000000 #000000; padding: 0.04in 0in 0.04in 0.04in;" width="50%"><span style="text-decoration: underline;"><strong>Option Available</strong></span></td>
<td style="border: 1px solid #000000; padding: 0.04in;" width="50%"><span style="text-decoration: underline;"><strong>Working</strong></span></td>
</tr>
<tr valign="TOP">
<td style="border-width: medium medium 1px 1px; border-style: none none solid solid; border-color: -moz-use-text-color -moz-use-text-color #000000 #000000; padding: 0in 0in 0.04in 0.04in;" width="50%">-a, &#8211;all</td>
<td style="border-width: medium 1px 1px; border-style: none solid solid; border-color: -moz-use-text-color #000000 #000000; padding: 0in 0.04in 0.04in;" width="50%">Equivalent to <strong>-b</strong> <strong>-d</strong> <strong>&#8211;login</strong> <strong>-p</strong> <strong>-r</strong> <strong>-t</strong> <strong>-T</strong> <strong>-u</strong>.</td>
</tr>
<tr valign="TOP">
<td style="border-width: medium medium 1px 1px; border-style: none none solid solid; border-color: -moz-use-text-color -moz-use-text-color #000000 #000000; padding: 0in 0in 0.04in 0.04in;" width="50%">am i</td>
<td style="border-width: medium 1px 1px; border-style: none solid solid; border-color: -moz-use-text-color #000000 #000000; padding: 0in 0.04in 0.04in;" width="50%">Print the name of invoking user only i.e current terminal.</td>
</tr>
<tr valign="TOP">
<td style="border-width: medium medium 1px 1px; border-style: none none solid solid; border-color: -moz-use-text-color -moz-use-text-color #000000 #000000; padding: 0in 0in 0.04in 0.04in;" width="50%">-b, &#8211;boot</td>
<td style="border-width: medium 1px 1px; border-style: none solid solid; border-color: -moz-use-text-color #000000 #000000; padding: 0in 0.04in 0.04in;" width="50%">Print the date and time of last system boot.</td>
</tr>
<tr valign="TOP">
<td style="border-width: medium medium 1px 1px; border-style: none none solid solid; border-color: -moz-use-text-color -moz-use-text-color #000000 #000000; padding: 0in 0in 0.04in 0.04in;" width="50%">-d, &#8211;dead</td>
<td style="border-width: medium 1px 1px; border-style: none solid solid; border-color: -moz-use-text-color #000000 #000000; padding: 0in 0.04in 0.04in;" width="50%">Print the list of dead processes.</td>
</tr>
<tr valign="TOP">
<td style="border-width: medium medium 1px 1px; border-style: none none solid solid; border-color: -moz-use-text-color -moz-use-text-color #000000 #000000; padding: 0in 0in 0.04in 0.04in;" width="50%">-H</td>
<td style="border-width: medium 1px 1px; border-style: none solid solid; border-color: -moz-use-text-color #000000 #000000; padding: 0in 0.04in 0.04in;" width="50%">Print column headings above the regular output.</td>
</tr>
<tr valign="TOP">
<td style="border-width: medium medium 1px 1px; border-style: none none solid solid; border-color: -moz-use-text-color -moz-use-text-color #000000 #000000; padding: 0in 0in 0.04in 0.04in;" width="50%">-l, &#8211;login</td>
<td style="border-width: medium 1px 1px; border-style: none solid solid; border-color: -moz-use-text-color #000000 #000000; padding: 0in 0.04in 0.04in;" width="50%">Prints list of only those lines on which the system is waiting for someone to login i.e of system login processes.</td>
</tr>
<tr valign="TOP">
<td style="border-width: medium medium 1px 1px; border-style: none none solid solid; border-color: -moz-use-text-color -moz-use-text-color #000000 #000000; padding: 0in 0in 0.04in 0.04in;" width="50%">-m</td>
<td style="border-width: medium 1px 1px; border-style: none solid solid; border-color: -moz-use-text-color #000000 #000000; padding: 0in 0.04in 0.04in;" width="50%">Same as <em><strong>who am i</strong></em>.</td>
</tr>
<tr valign="TOP">
<td style="border-width: medium medium 1px 1px; border-style: none none solid solid; border-color: -moz-use-text-color -moz-use-text-color #000000 #000000; padding: 0in 0in 0.04in 0.04in;" width="50%">-p, &#8211;process</td>
<td style="border-width: medium 1px 1px; border-style: none solid solid; border-color: -moz-use-text-color #000000 #000000; padding: 0in 0.04in 0.04in;" width="50%">Print the list of currently active processes spawned by Init.</td>
</tr>
<tr valign="TOP">
<td style="border-width: medium medium 1px 1px; border-style: none none solid solid; border-color: -moz-use-text-color -moz-use-text-color #000000 #000000; padding: 0in 0in 0.04in 0.04in;" width="50%">-q, &#8211;count</td>
<td style="border-width: medium 1px 1px; border-style: none solid solid; border-color: -moz-use-text-color #000000 #000000; padding: 0in 0.04in 0.04in;" width="50%">Print only the user names currently logged in and total number of users currently logged in.</td>
</tr>
<tr valign="TOP">
<td style="border-width: medium medium 1px 1px; border-style: none none solid solid; border-color: -moz-use-text-color -moz-use-text-color #000000 #000000; padding: 0in 0in 0.04in 0.04in;" width="50%">-r, &#8211;runlevel</td>
<td style="border-width: medium 1px 1px; border-style: none solid solid; border-color: -moz-use-text-color #000000 #000000; padding: 0in 0.04in 0.04in;" width="50%">Print the current runlevel of Init process.</td>
</tr>
<tr valign="TOP">
<td style="border-width: medium medium 1px 1px; border-style: none none solid solid; border-color: -moz-use-text-color -moz-use-text-color #000000 #000000; padding: 0in 0in 0.04in 0.04in;" width="50%">-s, &#8211;short</td>
<td style="border-width: medium 1px 1px; border-style: none solid solid; border-color: -moz-use-text-color #000000 #000000; padding: 0in 0.04in 0.04in;" width="50%">Print only name, line, and time. Which is the default behaviour</td>
</tr>
<tr valign="TOP">
<td style="border-width: medium medium 1px 1px; border-style: none none solid solid; border-color: -moz-use-text-color -moz-use-text-color #000000 #000000; padding: 0in 0in 0.04in 0.04in;" width="50%">-t, &#8211;time</td>
<td style="border-width: medium 1px 1px; border-style: none solid solid; border-color: -moz-use-text-color #000000 #000000; padding: 0in 0.04in 0.04in;" width="50%">Print the last system clock change.</td>
</tr>
<tr valign="TOP">
<td style="border-width: medium medium 1px 1px; border-style: none none solid solid; border-color: -moz-use-text-color -moz-use-text-color #000000 #000000; padding: 0in 0in 0.04in 0.04in;" width="50%">-u, &#8211;users</td>
<td style="border-width: medium 1px 1px; border-style: none solid solid; border-color: -moz-use-text-color #000000 #000000; padding: 0in 0.04in 0.04in;" width="50%">Print the list of currently logged in users.</td>
</tr>
</tbody>
</table>
<p>Here are some of the working examples of this command:</p>
<ol>
<li><strong><code>who -m</code> command</strong><br />
This command displays information of invoking user only. Following image illustrates this.</p>
<p><div id="attachment_3006" class="wp-caption aligncenter" style="width: 512px"><a href="http://howtoideas.net/the-who-command-terminal/who-m-command" rel="attachment wp-att-3006"><img class="size-full wp-image-3006" title="who -m command" src="http://howtoideas.net/wp-content/uploads/2011/12/who-m-command.png" alt="who -m command" width="502" height="205" /></a><p class="wp-caption-text">who -m command</p></div></li>
<li><strong><code>who -q</code> command</strong><br />
This command displays the user names currently logged in and total number of users currently logged in. In the following image, this command was run in the left terminal when other terminal was not open and in the other terminal when I logged in using other user id, it displays information about two users.</p>
<p><div id="attachment_3008" class="wp-caption aligncenter" style="width: 664px"><a href="http://howtoideas.net/the-who-command-terminal/who-q-command" rel="attachment wp-att-3008"><img class=" wp-image-3008 " title="who -q command" src="http://howtoideas.net/wp-content/uploads/2011/12/who-q-command.png" alt="who -q command" width="654" height="253" /></a><p class="wp-caption-text">who -q command</p></div></li>
</ol>
<p>Some other images of showing working of this command.</p>
<div id="attachment_3004" class="wp-caption aligncenter" style="width: 405px"><a href="http://howtoideas.net/the-who-command-terminal/who-command" rel="attachment wp-att-3004"><img class="size-full wp-image-3004" title="who command" src="http://howtoideas.net/wp-content/uploads/2011/12/who-command.png" alt="who command" width="395" height="105" /></a><p class="wp-caption-text">who command</p></div>
<div id="attachment_3003" class="wp-caption aligncenter" style="width: 367px"><a href="http://howtoideas.net/the-who-command-terminal/who-b-command" rel="attachment wp-att-3003"><img class="size-full wp-image-3003" title="who -b command" src="http://howtoideas.net/wp-content/uploads/2011/12/who-b-command.png" alt="who -b command" width="357" height="114" /></a><p class="wp-caption-text">who -b command</p></div>
<div id="attachment_3005" class="wp-caption aligncenter" style="width: 652px"><a href="http://howtoideas.net/the-who-command-terminal/who-h-command" rel="attachment wp-att-3005"><img class=" wp-image-3005 " title="who -H command" src="http://howtoideas.net/wp-content/uploads/2011/12/who-H-command.png" alt="who -H command" width="642" height="157" /></a><p class="wp-caption-text">who -H command</p></div>
<div id="attachment_3007" class="wp-caption aligncenter" style="width: 527px"><a href="http://howtoideas.net/the-who-command-terminal/who-p-command" rel="attachment wp-att-3007"><img class="size-full wp-image-3007" title="who -p command" src="http://howtoideas.net/wp-content/uploads/2011/12/who-p-command.png" alt="who -p command" width="517" height="131" /></a><p class="wp-caption-text">who -p command</p></div>
]]></content:encoded>
			<wfw:commentRss>http://howtoideas.net/the-who-command-terminal/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How To reverse the digits of a number using Shell Scripting</title>
		<link>http://howtoideas.net/how-to-reverse-the-digits-of-a-number-using-shell-scripting</link>
		<comments>http://howtoideas.net/how-to-reverse-the-digits-of-a-number-using-shell-scripting#comments</comments>
		<pubDate>Tue, 20 Dec 2011 19:12:45 +0000</pubDate>
		<dc:creator>Rohit</dc:creator>
				<category><![CDATA[Shell Scripting]]></category>
		<category><![CDATA[how]]></category>
		<category><![CDATA[number]]></category>
		<category><![CDATA[reverse]]></category>
		<category><![CDATA[reverse digits]]></category>
		<category><![CDATA[reverse order]]></category>
		<category><![CDATA[script]]></category>
		<category><![CDATA[scripting]]></category>
		<category><![CDATA[shell]]></category>
		<category><![CDATA[shell script]]></category>
		<category><![CDATA[to]]></category>

		<guid isPermaLink="false">http://howtoideas.net/?p=2995</guid>
		<description><![CDATA[In this tutorial, I will share a simple script to reverse a number provided through command line in Unix/Linux Operating System. The script will print the reversed digits of provided number and if no number or more than one numbers are provided, then it will print an error. Algorithm is fairly simple : Let n be the given number. Set rev and rem equals to 0. Find last digit of... <span class="meta-more"><a href="http://howtoideas.net/how-to-reverse-the-digits-of-a-number-using-shell-scripting">Read more &#187;</a></span>]]></description>
				<content:encoded><![CDATA[<p>In this tutorial, I will share a simple <strong>script</strong> to <strong>reverse a number</strong> provided through command line in <strong>Unix/Linux Operating System</strong>. The script will print the reversed digits of provided number and if no number or more than one numbers are provided, then it will print an error. Algorithm is fairly simple :</p>
<ol>
<li>Let <code>n</code> be the given number.</li>
<li>Set <code>rev</code> and <code>rem</code> equals to 0.</li>
<li>Find last digit of <code>n</code> and store in <code>rem</code> as <code>rem = n % 10.</code></li>
<li>Now calculate <code>rev</code> as <code>rev = rev * 10 + rem.</code></li>
<li>Remove the last digit from <code>n</code> by using <code>n = n / 10.</code></li>
<li>Check if <code>n</code> is greater than 0, if yes goto step 3, else step 7.</li>
<li>Print the number <code>rev</code> which is reverse of number <code>n</code>.</li>
</ol>
<p><span style="text-decoration: underline;"><strong>Instructions:</strong></span></p>
<ol>
<li>Enter the following line which tell the <strong>terminal</strong> while running the script to use <code>bash</code> to run the script.<br />
<blockquote>
<pre>#!/bin/bash</pre>
</blockquote>
</li>
<li>Now check if only a single argument is provided, if yes then its Ok, otherwise print an error message regarding this and exit the script.<br />
<blockquote>
<pre>if [ $# -ne 1 ]
then
    echo "Usage : $0 number"
    echo "To print the reverse of input number"
    echo "example for 1234 answer will be 4321"
    echo "provide a single number as parameter to script"
    exit 1
fi</pre>
</blockquote>
</li>
<li>Now assign the 1st parameter value to <code>n</code>, 0 to <code>rev</code> and <code>rem</code> both. (here <code>n</code>, <code>rev</code>, <code>rem</code> are temporary variables)<br />
<blockquote>
<pre>n=$1
rev=0
rem=0</pre>
</blockquote>
</li>
<li>Now in a while loop, which will run until value of <code>n</code> is greater than 0, apply the algorithm discussed above as follows.<br />
<blockquote>
<pre>while [ $n -gt 0 ]
do
    rem=`expr $n % 10`
    rev=`expr $rev \* 10 + $rem`
    n=`expr $n / 10`
done</pre>
</blockquote>
</li>
<li>Now print the value of variable <code>rev</code> which contains the digits in the reverse order as compared to original number provided.<br />
<blockquote>
<pre>echo "Reversed number is : $rev"</pre>
</blockquote>
</li>
</ol>
<p>Here is an image of the working sample of the script. (Script name is reverse stored in Documents folder)</p>
<div id="attachment_2996" class="wp-caption aligncenter" style="width: 494px"><a href="http://howtoideas.net/how-to-reverse-the-digits-of-a-number-using-shell-scripting/reverse-number" rel="attachment wp-att-2996"><img class="size-full wp-image-2996" title="Reverse Number using Shell Scripting" src="http://howtoideas.net/wp-content/uploads/2011/12/Reverse-Number.png" alt="Reverse Number using Shell Scripting" width="484" height="392" /></a><p class="wp-caption-text">Reverse Number using Shell Scripting</p></div>
<p>You can download the sample script from <a title="Reverse a Number using Shell Scripting." href="http://howtoideas.net/wp-content/uploads/Shell Commands/reverse">here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://howtoideas.net/how-to-reverse-the-digits-of-a-number-using-shell-scripting/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to enable automatic login in Ubuntu</title>
		<link>http://howtoideas.net/how-to-enable-automatic-login-in-ubuntu</link>
		<comments>http://howtoideas.net/how-to-enable-automatic-login-in-ubuntu#comments</comments>
		<pubDate>Sun, 18 Dec 2011 18:58:47 +0000</pubDate>
		<dc:creator>Rohit</dc:creator>
				<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[automatic]]></category>
		<category><![CDATA[automatic login ubuntu 11.10]]></category>
		<category><![CDATA[how]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[login]]></category>
		<category><![CDATA[to]]></category>

		<guid isPermaLink="false">http://howtoideas.net/?p=2978</guid>
		<description><![CDATA[By default Automatic Login feature is disabled for every user you create in Ubuntu for security reasons, but you can enable this feature which will not ask you to enter your account password when you try to login next time in your account. Enabling Automatic Login is not a best practice. But if you are sure that no one has physical access to your PC then you can enable this... <span class="meta-more"><a href="http://howtoideas.net/how-to-enable-automatic-login-in-ubuntu">Read more &#187;</a></span>]]></description>
				<content:encoded><![CDATA[<p>By default <strong>Automatic Login</strong> feature is disabled for every user you create in Ubuntu for security reasons, but you can enable this feature which will not ask you to enter your account password when you try to login next time in your account. Enabling Automatic Login is not a best practice. But if you are sure that no one has physical access to your PC then you can enable this feature as explained below.</p>
<p><span style="text-decoration: underline;"><strong>Instructions:</strong></span></p>
<ol>
<ol>
<li>Click on the User name on the top bar in top right corner as shown in following image.
<p><div id="attachment_2986" class="wp-caption aligncenter" style="width: 447px"><a href="http://howtoideas.net/how-to-enable-automatic-login-in-ubuntu/useraccount-2" rel="attachment wp-att-2986"><img class="size-full wp-image-2986" title="User Account Link" src="http://howtoideas.net/wp-content/uploads/2011/12/UserAccount1.png" alt="User Account Link" width="437" height="106" /></a><p class="wp-caption-text">User Account Link</p></div></li>
<li>From the pop up menu, click on the <strong>User Accounts</strong> link to open <strong>User Accounts </strong>dialogue.
<p><div id="attachment_2983" class="wp-caption aligncenter" style="width: 224px"><a href="http://howtoideas.net/how-to-enable-automatic-login-in-ubuntu/user-accounts" rel="attachment wp-att-2983"><img class="size-full wp-image-2983" title="User Accounts Popup" src="http://howtoideas.net/wp-content/uploads/2011/12/user-accounts.png" alt="User Accounts Popup" width="214" height="209" /></a><p class="wp-caption-text">User Accounts Pop up</p></div></li>
<li>In the User Accounts dialogue, select the user for which you want to enable automatic login.
<p><div id="attachment_2985" class="wp-caption aligncenter" style="width: 604px"><a href="http://howtoideas.net/how-to-enable-automatic-login-in-ubuntu/user-accounts-dialogue-2" rel="attachment wp-att-2985"><img class=" wp-image-2985 " title="User Accounts dialogue 2" src="http://howtoideas.net/wp-content/uploads/2011/12/User-Accounts-dialogue-2.png" alt="User Accounts dialogue" width="594" height="348" /></a><p class="wp-caption-text">User Accounts dialogue</p></div></li>
<li>Then click on the <strong>Unlock</strong> button on the top right part of the dialogue as shown in the following image to enable changes for this user account. It will ask you to authenticate you request by entering your password. Do it and proceed to next step.
<p><div id="attachment_2981" class="wp-caption aligncenter" style="width: 604px"><a href="http://howtoideas.net/how-to-enable-automatic-login-in-ubuntu/unlock-changes" rel="attachment wp-att-2981"><img class=" wp-image-2981 " title="Unlock Changes" src="http://howtoideas.net/wp-content/uploads/2011/12/unlock-changes.png" alt="Unlock Changes" width="594" height="348" /></a><p class="wp-caption-text">Unlock Changes</p></div></li>
<li>Now click on the grey area  saying <strong>&#8220;OFF&#8221;</strong> for Automatic Login which will change the text to <strong>&#8220;ON&#8221;</strong> as shown in following image.
<p><div id="attachment_2980" class="wp-caption aligncenter" style="width: 604px"><a href="http://howtoideas.net/how-to-enable-automatic-login-in-ubuntu/enable-automatic-login" rel="attachment wp-att-2980"><img class=" wp-image-2980 " title="Enable Automatic Login" src="http://howtoideas.net/wp-content/uploads/2011/12/enable-automatic-login.png" alt="Enable Automatic Login" width="594" height="348" /></a><p class="wp-caption-text">Enable Automatic Login</p></div></li>
<li>After enabling automatic login for an account, you will see a &#8220;tick&#8221; sign as shown in following image.
<p><div id="attachment_2979" class="wp-caption aligncenter" style="width: 604px"><a href="http://howtoideas.net/how-to-enable-automatic-login-in-ubuntu/automatic-login-enabled-sign" rel="attachment wp-att-2979"><img class=" wp-image-2979 " title="Automatic Login Enabled Sign" src="http://howtoideas.net/wp-content/uploads/2011/12/automatic-login-enabled-sign.png" alt="Automatic Login Enabled Sign" width="594" height="348" /></a><p class="wp-caption-text">Automatic Login Enabled Sign</p></div></li>
</ol>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://howtoideas.net/how-to-enable-automatic-login-in-ubuntu/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The passwd Command &#8211; Terminal</title>
		<link>http://howtoideas.net/the-passwd-command-terminal</link>
		<comments>http://howtoideas.net/the-passwd-command-terminal#comments</comments>
		<pubDate>Fri, 16 Dec 2011 22:19:36 +0000</pubDate>
		<dc:creator>Rohit</dc:creator>
				<category><![CDATA[Unix Terminal]]></category>
		<category><![CDATA[change password]]></category>
		<category><![CDATA[delete password]]></category>
		<category><![CDATA[expire password]]></category>
		<category><![CDATA[how]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[lock password]]></category>
		<category><![CDATA[passwd]]></category>
		<category><![CDATA[passwd example]]></category>
		<category><![CDATA[passwd file]]></category>
		<category><![CDATA[passwd man]]></category>
		<category><![CDATA[password status]]></category>
		<category><![CDATA[root]]></category>
		<category><![CDATA[Terminal]]></category>
		<category><![CDATA[terminal commands]]></category>
		<category><![CDATA[to]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[Unix]]></category>

		<guid isPermaLink="false">http://howtoideas.net/?p=2956</guid>
		<description><![CDATA[passwd is command or tool in Unix/Linux-based operating systems which enables the user to change or configure Password of a User account. The password entered by user is run through a Key Derivation Function which converts the plain text to equivalent hash which is encrypted one. Original password is not saved anywhere for security reasons, only this hashed version of new password is stored in /etc/passwd file. Hashed version of... <span class="meta-more"><a href="http://howtoideas.net/the-passwd-command-terminal">Read more &#187;</a></span>]]></description>
				<content:encoded><![CDATA[<p><code>passwd</code> is command or tool in Unix/Linux-based operating systems which enables the user to change or configure <strong>Password </strong>of a User account. The password entered by user is run through a <a href="http://en.wikipedia.org/wiki/Key_derivation_function" target="_blank">Key Derivation Function</a> which converts the plain text to equivalent hash which is encrypted one. Original password is not saved anywhere for security reasons, only this hashed version of new password is stored in <em>/etc/passwd</em> file. Hashed version of plain text is usually calculated by using <a href="http://en.wikipedia.org/wiki/Data_Encryption_Standard" target="_blank">DES</a> algorithm.</p>
<p><em>*** <span style="text-decoration: underline;">Note all the following information is tested on Ubuntu 11.10. We endeavor to keep the information up-to-date and correct, However, we cannot guarantee that information given on the site is accurate or up to date</span></em><span style="text-decoration: underline;">.</span></p>
<p><span style="text-decoration: underline;"><strong>Syntax </strong></span> : <strong>passwd</strong> <em>[<span style="text-decoration: underline;">options</span>] [<span style="text-decoration: underline;">LOGIN</span>]</em></p>
<p>Here <em>LOGIN</em> is the user-id whose password you want to change. If you want to change password of current user account, then there is no need to mention you user-id, but if you want to change password information of another user&#8217;s account, then you have to mention user-id.</p>
<p>Following table shows all the available <em>Options</em> which you can use to configure password of a user account with <code>passwd</code> command/tool.</p>
<table width="100%" border="1" cellspacing="5" cellpadding="5">
<colgroup>
<col width="128*" />
<col width="128*" /> </colgroup>
<tbody>
<tr valign="TOP">
<td width="50%">
<p align="LEFT"><span style="text-decoration: underline;"><strong>Option Available</strong></span></p>
</td>
<td width="50%">
<p align="LEFT"><span style="text-decoration: underline;"><strong>Working</strong></span></p>
</td>
</tr>
<tr valign="TOP">
<td width="50%">
<p align="LEFT">-a, &#8211;all</p>
</td>
<td width="50%">
<p align="LEFT">report password status on all accounts</p>
<p align="LEFT">can be used with -S option only</p>
</td>
</tr>
<tr valign="TOP">
<td width="50%">
<p align="LEFT">-d, &#8211;delete</p>
</td>
<td width="50%">
<p align="LEFT">delete the password for the named account</p>
</td>
</tr>
<tr valign="TOP">
<td width="50%">
<p align="LEFT">-e, &#8211;expire</p>
</td>
<td width="50%">
<p align="LEFT">force expire the password for the named account</p>
</td>
</tr>
<tr valign="TOP">
<td width="50%">
<p align="LEFT">-r, &#8211;repository REPOSITORY</p>
</td>
<td width="50%">
<p align="LEFT">change password in REPOSITORY repository</p>
<p align="LEFT">Available Repositories : files, nis or nisplus.</p>
</td>
</tr>
<tr valign="TOP">
<td width="50%">
<p align="LEFT">-l, &#8211;lock</p>
</td>
<td width="50%">
<p align="LEFT">lock the password of the named account</p>
</td>
</tr>
<tr valign="TOP">
<td width="50%">
<p align="LEFT">-S, &#8211;status</p>
</td>
<td width="50%">
<p align="LEFT">report password status on the named account</p>
</td>
</tr>
</tbody>
</table>
<p>Here are some of the working examples of this command</p>
<ol>
<li><strong>Changing the password of current account without using any option</strong><br />
For this you can refer to another article which can be found <a href="http://howtoideas.net/how-to-change-user-account-password-using-terminal" target="_blank" class="broken_link">here</a>.</li>
<li><strong>Changing the password of current account without using any option</strong><br />
Type in the following command to change password for another user&#8217;s account. For this you must have Super User rights, otherwise it will show an error <strong>&#8220;You may not view or modify password information for [user-id]&#8220;</strong>. In the following example, I am changing password of the User account with user-id <em>howtoideas</em>.</p>
<blockquote><p><code>sudo passwd howtoideas</code></p></blockquote>
<p>It will ask you the password of the current account to use <code>sudo</code> command and then it will ask you to enter new password of the other user account twice, and then it will show you an output message as shown in following image.</p>
<p><div id="attachment_2963" class="wp-caption aligncenter" style="width: 655px"><a href="http://howtoideas.net/the-passwd-command-terminal/password-another-account" rel="attachment wp-att-2963"><img class=" wp-image-2963" title="Change Password of another account" src="http://howtoideas.net/wp-content/uploads/2011/12/password-another-account.png" alt="Change Password of another account" width="645" height="190" /></a><p class="wp-caption-text">Change Password of another account</p></div></li>
<li><strong>Deleting password using <code>-d</code> option</strong><br />
Next time your Operating System will not ask for a password to log into this account. In the following example I am changing the deleting the password of howtoideas user account. If you want to delete password of your own account, then there is no need to add user-id at the end of command.</p>
<blockquote><p><code>sudo passwd -d howtoideas</code></p></blockquote>
<p>Here is an image of the tested command.</p>
<p><div id="attachment_2962" class="wp-caption aligncenter" style="width: 444px"><a href="http://howtoideas.net/the-passwd-command-terminal/password-delete" rel="attachment wp-att-2962"><img class="size-full wp-image-2962" title="Delete Password" src="http://howtoideas.net/wp-content/uploads/2011/12/Password-delete.png" alt="Delete Password" width="434" height="109" /></a><p class="wp-caption-text">Delete Password</p></div></li>
<li><strong>Forcefully expires the password of a user account using <code>-e</code> option<br />
</strong>This will expire the current password of the user account and next time when this user tries to log into his account, System will ask the user to enter new password as enforced by root. Following command will expire the password of <em>howtoideas</em>user account.</p>
<blockquote><p><code>sudo passwd -e howtoideas</code></p></blockquote>
<p>Following image shows the working of this command.</p>
<div id="attachment_2961" class="wp-caption aligncenter" style="width: 459px"><a href="http://howtoideas.net/the-passwd-command-terminal/password-expiration" rel="attachment wp-att-2961"><img class="size-full wp-image-2961" title="Password Expiration Information Change" src="http://howtoideas.net/wp-content/uploads/2011/12/Password-Expiration.png" alt="Password Expiration Information Change" width="449" height="119" /></a><p class="wp-caption-text">Change Password Expiration Information</p></div>
<p>In following image, I am trying to log into <em>howtoideas</em> account, and see Terminal is asking to change the current password as enforced by root.</p>
<p><div id="attachment_2967" class="wp-caption aligncenter" style="width: 635px"><a href="http://howtoideas.net/the-passwd-command-terminal/change-password-root-enforced" rel="attachment wp-att-2967"><img class="size-full wp-image-2967" title="Change password root enforced" src="http://howtoideas.net/wp-content/uploads/2011/12/Change-password-root-enforced.png" alt="Change password root enforced" width="625" height="375" /></a><p class="wp-caption-text">Change password root enforced</p></div></li>
<li><strong>Lock account password using <code>-l</code> option<br />
</strong>This option will lock the user account password and user will not be able to log into his account even after providing correct information. In the following command I am locking the <em>howtoideas</em>user account password.</p>
<blockquote><p><code>sudo passwd -l howtoideas</code></p></blockquote>
<p>Following image shows the output of upper command.</p>
<div id="attachment_2964" class="wp-caption aligncenter" style="width: 448px"><a href="http://howtoideas.net/the-passwd-command-terminal/lock-user-account-password" rel="attachment wp-att-2964"><img class="size-full wp-image-2964" title="lock user account password" src="http://howtoideas.net/wp-content/uploads/2011/12/lock-user-account-password.png" alt="lock user account password" width="438" height="123" /></a><p class="wp-caption-text">lock user account password</p></div>
<p>Now if i try to log into <em>howtoideas</em> account, I won&#8217;t be able to do so, even after providing correct password as shown in the following image.</p>
<p><div id="attachment_2965" class="wp-caption aligncenter" style="width: 453px"><a href="http://howtoideas.net/the-passwd-command-terminal/locked-password" rel="attachment wp-att-2965"><img class="size-full wp-image-2965" title="Locked Password" src="http://howtoideas.net/wp-content/uploads/2011/12/Locked-Password.png" alt="Locked Password" width="443" height="186" /></a><p class="wp-caption-text">Locked Account Password</p></div></li>
<li><strong>Checking status of a particular account or all the accounts using <code>-S</code> option</strong><br />
This option will show the status information of a user account. The information shown is in the following order</p>
<blockquote><p>name status mm/dd/yy min max warn</p></blockquote>
<table border="1" cellspacing="5" cellpadding="5">
<tbody>
<tr>
<td valign="top">name</td>
<td valign="top">The login ID of the user.</td>
</tr>
<tr>
<td valign="top">status</td>
<td valign="top">Status of the name:<br />
PS or P = Password Enabled account<br />
LK or L = Locked<br />
NP = No Password<br />
NL = No login account</td>
</tr>
<tr>
<td valign="top">mm/dd/yy</td>
<td valign="top">The month date and year that the password was last changed.</td>
</tr>
<tr>
<td valign="top">min</td>
<td valign="top">The minimum number of days between password changes.</td>
</tr>
<tr>
<td valign="top">max</td>
<td valign="top">The maximum number of days the password is valid for the name.</td>
</tr>
<tr>
<td valign="top">warn</td>
<td valign="top">The number of days relative to max before the passwd uses pam for password management.</td>
</tr>
</tbody>
</table>
<p>Following command will showing the information of <em>howtoideas</em> account.</p>
<blockquote><p><code>sudo passwd -S howtoideas</code></p></blockquote>
<p>Following image shows the output of upper command. See the <em>L</em> character in image after <em>howtoideas</em> in the output which shows that the account is locked. This is because in previous point I locked this account for example purpose.<br />
<strong></strong></p>
<div id="attachment_2966" class="wp-caption aligncenter" style="width: 452px"><a href="http://howtoideas.net/the-passwd-command-terminal/locked-account" rel="attachment wp-att-2966"><img class=" wp-image-2966" title="Locked account Information" src="http://howtoideas.net/wp-content/uploads/2011/12/Locked-account.png" alt="Locked account Information" width="442" height="103" /></a><p class="wp-caption-text">Locked account Information</p></div>
<p><strong><br />
</strong></li>
<li><strong>Checking status of a particular account or all the accounts using <code>-S</code> and <code>-a </code></strong>Following command will output the password status information of all the account present in the system.<br />
<blockquote><p><code>sudo passwd -S -a</code></p></blockquote>
<p>Following image shows the output of upper command<br />
<strong></strong></p>
<p><div id="attachment_2960" class="wp-caption aligncenter" style="width: 460px"><a href="http://howtoideas.net/the-passwd-command-terminal/password-status-of-all-accounts" rel="attachment wp-att-2960"><img class="size-full wp-image-2960" title="Password status of all accounts" src="http://howtoideas.net/wp-content/uploads/2011/12/Password-status-of-all-accounts.png" alt="Password status of all accounts" width="450" height="698" /></a><p class="wp-caption-text">Password Status Information of all user accounts</p></div></li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://howtoideas.net/the-passwd-command-terminal/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
