    <?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>Yet Another Linux BlogYet Another Linux Blog &#187; Tips</title>
	<atom:link href="http://linux-blog.org/category/tips/feed/" rel="self" type="application/rss+xml" />
	<link>http://linux-blog.org</link>
	<description>Open Source, Open Blog</description>
	<lastBuildDate>Wed, 14 Mar 2012 23:18:15 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
		<item>
		<title>Conky Always on Top Fix in Openbox</title>
		<link>http://linux-blog.org/conky-always-on-top-fix-in-openbox/</link>
		<comments>http://linux-blog.org/conky-always-on-top-fix-in-openbox/#comments</comments>
		<pubDate>Sat, 08 Oct 2011 00:57:54 +0000</pubDate>
		<dc:creator>devnet</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[conky]]></category>
		<category><![CDATA[minimal]]></category>
		<category><![CDATA[openbox]]></category>
		<category><![CDATA[pypanel]]></category>
		<category><![CDATA[tint2]]></category>
		<category><![CDATA[wbar]]></category>

		<guid isPermaLink="false">http://linux-blog.org/?p=2013</guid>
		<description><![CDATA[I hit a snag recently when installing Openbox on the newest Alpha2 for Unity Linux.  I initiated Conky in my autostart.sh and it was always on top&#8230;of everything on my desktop.  That&#8217;s not a good thing when you&#8217;re trying to browse the web with your Conky layout on top of your browser.  After thinking about [...]]]></description>
			<content:encoded><![CDATA[<p>I hit a snag recently when installing <a title="Openbox" href="http://openbox.org/" onclick="return TrackClick('http%3A%2F%2Fopenbox.org%2F','Openbox')" target="_blank">Openbox</a> on the newest Alpha2 for <a title="Unity Linux" href="http://unity-linux.org" onclick="return TrackClick('http%3A%2F%2Funity-linux.org','Unity+Linux')" target="_blank">Unity Linux</a>.  I initiated <a title="Conky" href="http://conky.sourceforge.net/" onclick="return TrackClick('http%3A%2F%2Fconky.sourceforge.net%2F','Conky')" target="_blank">Conky</a> in my autostart.sh and it was <span style="text-decoration: underline;">always</span> on top&#8230;of everything on my desktop.  That&#8217;s not a good thing when you&#8217;re trying to browse the web with your Conky layout on top of your browser.  After thinking about some of the settings, I thought maybe that <em>own_window</em> setting might be good to play around with in conky settings&#8230;however, after a few tries, that didn&#8217;t pan out and fix this problem.</p>
<p>I recalled something similar with <a title="wbar" href="http://code.google.com/p/wbar/" onclick="return TrackClick('http%3A%2F%2Fcode.google.com%2Fp%2Fwbar%2F','wbar')" target="_blank">wbar</a> in Openbox&#8230;it would draw itself on top only and have a large black box around it.  No matter what I tried, I couldn&#8217;t get it to not display the bar nor get it to stop displaying on top.  I eventually would have to kill the PID and restart the program; then I tried something&#8230;on accident actually&#8230;<a title="PyPanel" href="http://pypanel.sourceforge.net/" onclick="return TrackClick('http%3A%2F%2Fpypanel.sourceforge.net%2F','PyPanel')" target="_blank">pypanel</a>, my previous panel, displayed so fast I had to make it sleep to avoid problems.  So I just replaced pypanel with wbar and let it go.  Wouldn&#8217;t you know it, Wbar displayed fine and in all it&#8217;s glory after that.</p>
<p>I tried the same with Conky and I am happy to report it works just fine to solve the &#8220;always on top&#8221; issue.  To make a task sleep before running in your autostart.sh, alter it as follows:</p>
<pre class="brush: plain; title: ; notranslate">(sleep 6 &amp;&amp; program) &amp;</pre>
<p>Where 6 is the number of seconds you want things to sleep and program is the program you wish to run.  Hopefully this helps a few people out&#8230;it threw me for a loop for a while before I was able to solve it.  Gratuitous and obligatory screenshot is below:</p>
<div id="attachment_2014" class="wp-caption aligncenter" style="width: 469px"><a href="http://linux-blog.org/wp-content/uploads/2011/10/openboxconky.png" onclick="return TrackClick('http%3A%2F%2Flinux-blog.org%2Fwp-content%2Fuploads%2F2011%2F10%2Fopenboxconky.png','openboxconky')"><img class="size-full wp-image-2014   " title="openboxconky" src="http://linux-blog.org/wp-content/uploads/2011/10/openboxconky.png" onclick="return TrackClick('http%3A%2F%2Flinux-blog.org%2Fwp-content%2Fuploads%2F2011%2F10%2Fopenboxconky.png','openboxconky')" alt="openbox and conky" width="459" height="258" /></a><p class="wp-caption-text">openbox, conky &amp; tint2</p></div>
<p><a href="http://linux-blog.org/conky-always-on-top-fix-in-openbox/" rel="bookmark">Conky Always on Top Fix in Openbox</a> originally appeared on <a href="http://linux-blog.org">Yet Another Linux Blog</a> on October 7, 2011.</p>
]]></content:encoded>
			<wfw:commentRss>http://linux-blog.org/conky-always-on-top-fix-in-openbox/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Some Random Helpful Hints</title>
		<link>http://linux-blog.org/some-random-helpful-hints/</link>
		<comments>http://linux-blog.org/some-random-helpful-hints/#comments</comments>
		<pubDate>Sat, 11 Jun 2011 03:34:41 +0000</pubDate>
		<dc:creator>devnet</dc:creator>
				<category><![CDATA[Misc]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[cli]]></category>
		<category><![CDATA[find]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[rsync]]></category>
		<category><![CDATA[tips and tricks]]></category>

		<guid isPermaLink="false">http://linux-blog.org/?p=1947</guid>
		<description><![CDATA[I&#8217;ve been slowly collecting a few commands that are useful to me for various things while using Linux.  I figured that I would share some of these handy commands.  In no particular order, they are: To copy, preserving permissions AND structure AND recursively, from a remote system to your local system: Please note that the [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been slowly collecting a few commands that are useful to me for various things while using Linux.  I figured that I would share some of these handy commands.  In no particular order, they are:</p>
<p><strong>To copy, preserving permissions AND structure AND recursively, from a remote system to your local system:</strong></p>
<pre class="brush: plain; title: ; notranslate">rsync -r -a -v -e ssh server1.address.com:/dir/youwant/to/copy/ /local/location/for/directory/</pre>
<p>Please note that the code above assumes that you are using key based authentication and not password.  For password based authentication, it would look more like this:</p>
<pre class="brush: plain; title: ; notranslate">rsync -r -a -v -e ssh remoteuser@server1.address.com:/dir/youwant/to/copy/ /local/location/for/directory/</pre>
<p><strong>To remove all files matching a certain extension (xml in my example) in a directory:</strong></p>
<pre class="brush: plain; title: ; notranslate">find . -type f -name &quot;*.xml&quot; -exec rm -f {} \;</pre>
<p><strong>To go into a location, find all files that match a certain extension (jpg in my example) and move them to a different directory:</strong></p>
<pre class="brush: plain; title: ; notranslate">find . -name &quot;*.jpg&quot; | xargs -i mv '{}' /location/to/move/them/to/ </pre>
<p><strong>To recursively remove empty directory from the directory you are currently in (your pwd):</strong></p>
<pre class="brush: plain; title: ; notranslate">find -depth -type d -empty -exec rmdir {} \;</pre>
<p>These are a few of the commands that I&#8217;ve found useful in the past few weeks.  I hope you find them useful as well.  I&#8217;ll be test driving quite a few different distributions and reporting back what I find as well as experimenting with various different commands&#8230;I really like find because it is so powerful so look for some more posts with uses of the find command.  Thanks for reading and sorry for my lapse in posting this past month!</p>
<p><a href="http://linux-blog.org/some-random-helpful-hints/" rel="bookmark">Some Random Helpful Hints</a> originally appeared on <a href="http://linux-blog.org">Yet Another Linux Blog</a> on June 10, 2011.</p>
]]></content:encoded>
			<wfw:commentRss>http://linux-blog.org/some-random-helpful-hints/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Install Firefox 4 on Linux Mint Debian Edition (LMDE)</title>
		<link>http://linux-blog.org/install-firefox-4-on-linux-mint-debian-edition-lmde/</link>
		<comments>http://linux-blog.org/install-firefox-4-on-linux-mint-debian-edition-lmde/#comments</comments>
		<pubDate>Fri, 01 Apr 2011 15:48:27 +0000</pubDate>
		<dc:creator>devnet</dc:creator>
				<category><![CDATA[Tips]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[desktop]]></category>
		<category><![CDATA[Distros]]></category>
		<category><![CDATA[Linux Mint]]></category>
		<category><![CDATA[LMDE]]></category>
		<category><![CDATA[tips and tricks]]></category>

		<guid isPermaLink="false">http://linux-blog.org/?p=1889</guid>
		<description><![CDATA[I am testing out Linux Mint Debian Edition (LMDE) and wanted to benefit from Firefox 4 and all its speediness.  It&#8217;s not available in the repositories and since LMDE uses Firefox and NOT Iceweasel, you really can&#8217;t install it from the Mozilla Debian repository.  So, I decided to manually install things. Normally I don&#8217;t like [...]]]></description>
			<content:encoded><![CDATA[<p>I am testing out <a title="Linux Mint Debian Edition" href="http://www.linuxmint.com/download_lmde.php" onclick="return TrackClick('http%3A%2F%2Fwww.linuxmint.com%2Fdownload_lmde.php','Linux+Mint+Debian+Edition')" target="_blank">Linux Mint Debian Edition</a> (LMDE) and wanted to benefit from <a title="Firefox 4" href="http://www.mozilla.com/en-US/firefox/fx/" onclick="return TrackClick('http%3A%2F%2Fwww.mozilla.com%2Fen-US%2Ffirefox%2Ffx%2F','Firefox+4')" target="_blank">Firefox 4</a> and all its speediness.  It&#8217;s not available in the repositories and since LMDE uses Firefox and NOT Iceweasel, you really can&#8217;t install it from the <a title="Mozilla Debian Repository" href="http://mozilla.debian.net/" onclick="return TrackClick('http%3A%2F%2Fmozilla.debian.net%2F','Mozilla+Debian+Repository')" target="_blank">Mozilla Debian repository</a>.  So, I decided to manually install things.</p>
<p>Normally I don&#8217;t like to manually install things outside the repository because when updates are pushed, there is no upstream source to differentiate from&#8230;so your chances of running outdated software increase unless you are vigilant.  Luckily, I consider myself vigilant.  Unfortunately, I&#8217;m not as vigilant as I consider myself to be&#8230;so I&#8217;ve added in reminders for myself on my Google calendar to check for Firefox 4 updates.</p>
<p>So, here&#8217;s how to get Firefox 4 onto your LMDE desktop&#8230;First, uninstall the version of Firefox you have using Synaptic or the software center.  Open a terminal up and let&#8217;s get started.</p>
<p>Create a temporary directory to house a downloaded and unzipped Firefox:</p>
<pre class="brush: plain; title: ; notranslate">cd ~/ &amp;&amp; mkdir tmp &amp;&amp; cd tmp/</pre>
<p>Next, let&#8217;s download and unzip it (please note this is for en-US version only&#8230;you&#8217;ll have to adjust the URL for diff. languages):</p>
<p><strong>32bit</strong></p>
<pre class="brush: plain; title: ; notranslate">wget http://releases.mozilla.org/pub/mozilla.org/firefox/releases/latest-4.0/linux-i686/en-US/firefox-4.0.tar.bz2</pre>
<p><strong>64bit</strong></p>
<pre class="brush: plain; title: ; notranslate">wget http://releases.mozilla.org/pub/mozilla.org/firefox/releases/latest-4.0/linux-x86_64/en-US/firefox-4.0.tar.bz2</pre>
<p>Now let&#8217;s unzip and extract it:</p>
<pre class="brush: plain; title: ; notranslate">tar -xvjf firefox*.tar.bz2</pre>
<p>Now let&#8217;s move the newly extracted items to <em>/usr/local</em> so it can be used by the system:</p>
<pre class="brush: plain; title: ; notranslate">sudo mv firefox /usr/local/firefox4</pre>
<p>Now we need to create a link so that applications calling firefox 4 access it correctly:</p>
<pre class="brush: plain; title: ; notranslate">sudo ln -s /usr/local/firefox4/firefox /usr/local/bin/firefox4</pre>
<p>Ok, the hard part is done&#8230;but you don&#8217;t have a menu entry for it nor a shortcut you can execute.  Let&#8217;s do that now.  Right click your mint menu and choose &#8220;edit menu&#8221;.  Now, select the &#8220;Internet&#8221; menu in the left hand pane.  Click the &#8220;New Item&#8221; button.  The following window will pop up&#8230;fill it in with the information contained in the picture below:</p>
<p>The command line should be (remember the link we made above? let&#8217;s use it!):</p>
<pre class="brush: plain; title: ; notranslate">/usr/local/firefox4/firefox %u</pre>
<p><a href="http://linux-blog.org/wp-content/uploads/2011/04/Screenshot-Launcher-Properties.png" onclick="return TrackClick('http%3A%2F%2Flinux-blog.org%2Fwp-content%2Fuploads%2F2011%2F04%2FScreenshot-Launcher-Properties.png','Screenshot-Launcher+Properties')"><img class="aligncenter size-full wp-image-1890" title="Screenshot-Launcher Properties" src="http://linux-blog.org/wp-content/uploads/2011/04/Screenshot-Launcher-Properties.png" onclick="return TrackClick('http%3A%2F%2Flinux-blog.org%2Fwp-content%2Fuploads%2F2011%2F04%2FScreenshot-Launcher-Properties.png','Screenshot-Launcher+Properties')" alt="launcher properties" width="409" height="212" /></a></p>
<p>Notice in the picture above the Firefox icon is present&#8230;yours most likely isn&#8217;t.  In order to set the icon, click the area where it appears above and then select the following image:</p>
<p><a href="http://linux-blog.org/wp-content/uploads/2011/04/select-icon.png" onclick="return TrackClick('http%3A%2F%2Flinux-blog.org%2Fwp-content%2Fuploads%2F2011%2F04%2Fselect-icon.png','select-icon')"><img class="aligncenter size-full wp-image-1891" title="select-icon" src="http://linux-blog.org/wp-content/uploads/2011/04/select-icon.png" onclick="return TrackClick('http%3A%2F%2Flinux-blog.org%2Fwp-content%2Fuploads%2F2011%2F04%2Fselect-icon.png','select-icon')" alt="" width="666" height="527" /></a></p>
<p>When you&#8217;re finished, click close.  Firefox 4 should now appear under &#8220;Internet&#8221; in your Mint  Menu.  You can now right click that item and add it to your favorites if  you wish.</p>
<p>Now let&#8217;s make sure you list Firefox 4 as the default web browser for Gnome.  Do this by opening up the control center in the Mint Menu.  Select &#8220;Preferred Applications&#8221; inside the control center.  Make sure that you choose &#8216;custom&#8217; in the drop down menu shown below and the path for the command will be the same as it was for your launcher but instead of a <em>%u</em> you can use a <em>%s</em> at the end of the command (as shown in the picture below):</p>
<p><a href="http://linux-blog.org/wp-content/uploads/2011/04/Screenshot-Preferred-Applications.png" onclick="return TrackClick('http%3A%2F%2Flinux-blog.org%2Fwp-content%2Fuploads%2F2011%2F04%2FScreenshot-Preferred-Applications.png','Screenshot-Preferred+Applications')"><img class="aligncenter size-full wp-image-1894" title="Screenshot-Preferred Applications" src="http://linux-blog.org/wp-content/uploads/2011/04/Screenshot-Preferred-Applications.png" onclick="return TrackClick('http%3A%2F%2Flinux-blog.org%2Fwp-content%2Fuploads%2F2011%2F04%2FScreenshot-Preferred-Applications.png','Screenshot-Preferred+Applications')" alt="preferred applications" width="473" height="425" /></a></p>
<p>That should be everything you need to have a good Firefox 4 experience in LMDE.  To uninstall things, you can simply delete the menu items and then delete the directories we created during the install process.</p>
<p>Hopefully this will help those of you out there who want Firefox 4 on your LMDE install!</p>
<p><a href="http://linux-blog.org/install-firefox-4-on-linux-mint-debian-edition-lmde/" rel="bookmark">Install Firefox 4 on Linux Mint Debian Edition (LMDE)</a> originally appeared on <a href="http://linux-blog.org">Yet Another Linux Blog</a> on April 1, 2011.</p>
]]></content:encoded>
			<wfw:commentRss>http://linux-blog.org/install-firefox-4-on-linux-mint-debian-edition-lmde/feed/</wfw:commentRss>
		<slash:comments>13</slash:comments>
		</item>
		<item>
		<title>Chasing Your &#8216;Tail&#8217; With Linux</title>
		<link>http://linux-blog.org/chasing-your-tail-with-linux/</link>
		<comments>http://linux-blog.org/chasing-your-tail-with-linux/#comments</comments>
		<pubDate>Thu, 27 Jan 2011 06:04:24 +0000</pubDate>
		<dc:creator>usama</dc:creator>
				<category><![CDATA[Guest Editors]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[cli]]></category>
		<category><![CDATA[commands]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[tail]]></category>
		<category><![CDATA[tips and tricks]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://linux-blog.org/?p=1804</guid>
		<description><![CDATA[&#8216;GNU tail&#8217; is a small utility which prints (by default) the last 10 lines of any file. This an amazing piece of software not only allows you to see the last part of a file but also enables you to monitor a file’s changes without opening the file. &#8216;tail&#8217; can be used alone or can [...]]]></description>
			<content:encoded><![CDATA[<p>&#8216;GNU tail&#8217; is a small utility which prints (by default) the last 10 lines of any file. This an amazing piece of software not only allows you to see the last part of a file but also enables you to monitor a file’s changes without opening the file.</p>
<p>&#8216;tail&#8217; can be used alone or can be combined with other commands like &#8216;grep&#8217;, &#8216;ls&#8217; etc.</p>
<p>To use &#8216;tail&#8217;, let’s first create a text file. You can create the file by issuing following command in terminal;</p>
<pre class="brush: plain; title: ; notranslate">touch my_file</pre>
<p>Now open my_file with your favorite text editor (nano in my case) and write some lines. For this article, I have written the following 15 lines;</p>
<pre class="brush: plain; title: ; notranslate">this is the 1st line
this is the 2nd line
this is the 3rd line
this is the 4th line
this is the 5th line
this is the 6th line
this is the 7th line
this is the 8th line
this is the 9th line
this is the 10th line
this is the 11th line
this is the 12th line
this is the 13th line
this is the 14th line
this is the 15th line</pre>
<p>Now issue the following command in terminal;</p>
<pre class="brush: plain; title: ; notranslate">tail my_file</pre>
<p>It will print the last 10 lines which would be the “this is the 6th line” through “this is the 15th line”.</p>
<p>You can control the number of lines which &#8216;tail&#8217; will print. You can either increase or decrease the number of lines. For example, if you want &#8216;tail&#8217; to show only last 3 lines, you can do this by issuing the following command;</p>
<pre class="brush: plain; title: ; notranslate">tail -n 3 my_file</pre>
<p>Now it will print only last 3 lines. You can use any number of lines instead of 3. Or you can use a plus sign like;</p>
<pre class="brush: plain; title: ; notranslate">tail -n+7 my_file</pre>
<p>&#8216;tail&#8217; will start printing from 7th line to the end of the file.</p>
<p>You can view the desired file with respect to size. Issue the following command in terminal;</p>
<pre class="brush: plain; title: ; notranslate">tail -c 14 my_file</pre>
<p>And it will show the output of last 14 bytes. In my case, the output was;</p>
<p><em>the 15th line</em></p>
<p>&#8216;tail&#8217; not only displays the static output of a file but it can also monitor the file for changes. A &#8216;-f&#8217; option is used with &#8216;tail&#8217; and it starts acting like a monitoring tool which not only displays the last few lines but also constantly updates the output as the file changes. Here is a very popular example;</p>
<pre class="brush: plain; title: ; notranslate">tail -f /var/log/message</pre>
<p>&#8216;tail&#8217; will print the last 10 lines of &#8216;message&#8217; file. If you now plug-in you USB stick, you will notice that the change in &#8216;message&#8217; file will instantly be reported by &#8216;tail&#8217;. To release the cursor press Ctrl+c.</p>
<p>There are many other useful options which you can use with &#8216;tail&#8217; like;</p>
<pre class="brush: plain; title: ; notranslate">tail -q my_file        # never output headers</pre>
<pre class="brush: plain; title: ; notranslate">tail -v my_file        # always outputs headers</pre>
<p>You can combine &#8216;tail&#8217; with other utilities like &#8216;ls&#8217;, &#8216;grep&#8217;, &#8216;head&#8217; etc.</p>
<p>You can combine &#8216;tail&#8217; with &#8216;grep&#8217; to get lines with some specific &#8216;word&#8217;.</p>
<pre class="brush: plain; title: ; notranslate">tail -n 5 my_file | grep 14</pre>
<p>It will print only those lines out of last 5 which contains the word &#8217;14&#8242;. In my case the output was:</p>
<p><em>this is 14th line    # &#8217;14&#8242; will be highlighted</em></p>
<p>&#8216;tail&#8217; can also be combined with &#8216;ls&#8217; to get the list of last few files/folders. For example, if you issue the following command;</p>
<pre class="brush: plain; title: ; notranslate">ls -l | tail -n 2</pre>
<p>It will give a long listing of files/folders but will show the last 2 entries of the working directory.</p>
<p>These are just two examples of combining &#8216;tail&#8217; with other utilities. There are countless examples of combination of &#8216;tail&#8217; and other softwares.</p>
<p>&#8216;GNU tail&#8217; is a very handy tool. It can output any amount of data depending upon the options used. It makes the work of an ordinary user much easer and helps him/her find information in files more efficiently. To become an expert in Linux, this is a mandatory utility over which a user must have complete mastery.  Hopefully, this <a href="http://readalquran.org" onclick="return TrackClick('http%3A%2F%2Freadalquran.org','tutorial')" target="_blank">tutorial </a>gets you started chasing your tail!</p>
<p><a href="http://linux-blog.org/chasing-your-tail-with-linux/" rel="bookmark">Chasing Your &#8216;Tail&#8217; With Linux</a> originally appeared on <a href="http://linux-blog.org">Yet Another Linux Blog</a> on January 27, 2011.</p>
]]></content:encoded>
			<wfw:commentRss>http://linux-blog.org/chasing-your-tail-with-linux/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Using &#8216;Alias&#8217; in Linux</title>
		<link>http://linux-blog.org/using-alias-in-linux/</link>
		<comments>http://linux-blog.org/using-alias-in-linux/#comments</comments>
		<pubDate>Thu, 23 Dec 2010 14:42:50 +0000</pubDate>
		<dc:creator>usama</dc:creator>
				<category><![CDATA[Guest Editors]]></category>
		<category><![CDATA[Misc]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[cli]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[tips and tricks]]></category>

		<guid isPermaLink="false">http://linux-blog.org/?p=1770</guid>
		<description><![CDATA[There comes a time in every Linux users&#8217; life when you will open the Terminal more often than not because you have realized that it is faster, more efficient and more powerful than GUI (Graphical User Interface).  You&#8217;ll have started to learn more and more commands and now feel more comfortable with command prompt.  The [...]]]></description>
			<content:encoded><![CDATA[<p>There comes a time in every Linux users&#8217; life when you will open the Terminal more often than not because you have  realized that it is faster, more efficient and more powerful than GUI  (Graphical User Interface).  You&#8217;ll have started to learn more and more  commands and now feel more comfortable with command prompt.  The command  prompt is all about commands – short commands as well as long commands.   If you are like me then you may not like to type the long commands (or  even small commands) <img src='http://linux-blog.org/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>You may be thinking about some way to avoid typing commands over and over. Enter the ‘alias&#8217;.</p>
<p>The  &#8216;alias&#8217; tool is a way to make the complicated things simple (and simple  things simpler). You can use &#8216;alias&#8217; instead of long (or even short)  commands.  Now let’s see how the &#8216;alias&#8217; works.</p>
<p>&#8216;alias&#8217; can make difficult and lengthy commands easy. The general format of &#8216;alias&#8217; is:</p>
<pre class="brush: plain; title: ; notranslate">alias Any_Word=”Command”</pre>
<p>It  means you linked an existing command to a (New) Word. This ‘Any_Word&#8217;  may contain anything – any alpha-numeric symbol, ‘Any_Word’ as well as ‘Command’ are interchangeable  and can be used for the same purpose.</p>
<h2>Simple Commands Made Simpler</h2>
<p>As an example, &#8216;ls -l&#8217;  is used for listing directory contents in &#8216;long  listing format&#8217;. This &#8216;ls -l&#8217; can be replaced with a simpler alias. You  can set the ‘alias’ for ‘ls –l’ as follows:</p>
<pre class="brush: plain; title: ; notranslate">alias ll=”ls –l”</pre>
<p>Now you just have to type ‘ll’ (without quotes) to get ‘long listing format’.</p>
<p>Or if you frequently misspell ‘ls’ as ‘sl’ and don’t want to install ‘sl’ package, then, you can use the following alias:</p>
<pre class="brush: plain; title: ; notranslate">alias sl=”ls”</pre>
<p>Now, whenever you type &#8216;sl&#8217; in terminal, it will give you same results as &#8216;ls&#8217;.</p>
<p>Now  consider even simpler example. To close a Terminal (or logout), you  have to type &#8216;exit&#8217; in Terminal. This &#8216;exit&#8217; command can be made even  simpler by using the following ‘alias’:</p>
<pre class="brush: plain; title: ; notranslate">alias x=&quot;exit&quot;</pre>
<p>Now, you only have to type &#8216;x&#8217; in Terminal to &#8216;exit&#8217;</p>
<p>Other examples of &#8216;alias&#8217; are:</p>
<pre class="brush: plain; title: ; notranslate">alias cp=&quot;cp -iv&quot;
#make copy operation interactive and verbose</pre>
<pre class="brush: plain; title: ; notranslate">alias rm=&quot;rm -iv&quot;
#make remove operation interactive and verbose</pre>
<pre class="brush: plain; title: ; notranslate">alias mv=&quot;mv -iv&quot;
#make move operation interactive and verbose</pre>
<h2>Make Package Management A Bit Simpler</h2>
<p>If you use Debian (or its derivatives) then you will be familiar with APT.  It is an excellent package manager.</p>
<p>In Ubuntu, to install software using APT, you have to use the following command:</p>
<pre class="brush: plain; title: ; notranslate">sudo apt-get install &lt;sofware_name&gt;</pre>
<p>It is a long command and consumes a lot of your time and energy <img src='http://linux-blog.org/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>You can shorten this command by using &#8216;alias&#8217;.  Issue the following command in Terminal:</p>
<pre class="brush: plain; title: ; notranslate">alias Install=”sudo apt-get install”</pre>
<p>You can obviously use your own word instead of ‘Install’.</p>
<p>Now, you just have to type:</p>
<pre class="brush: plain; title: ; notranslate">Install &lt;software_name&gt;</pre>
<p>to install the (same) software. Simple, isn&#8217;t it?</p>
<p>You can simplify other aspects of APT. For example, you can use the following ‘alias’:</p>
<pre class="brush: plain; title: ; notranslate">alias Remove=”sudo apt-get remove”</pre>
<p>to uninstall a software.</p>
<p>Some other examples of attaching APT with &#8216;alias&#8217; are:</p>
<pre class="brush: plain; title: ; notranslate">alias Update=”sudo apt-get update”</pre>
<pre class="brush: plain; title: ; notranslate">alias Upgrade=”sudo apt-get upgrade”</pre>
<pre class="brush: plain; title: ; notranslate">alias Search=”apt-cache search”</pre>
<pre class="brush: plain; title: ; notranslate">alias Autoremove=”sudo apt-get autoremove”</pre>
<pre class="brush: plain; title: ; notranslate">alias Autoclean=”sudo apt-get autoclean”</pre>
<pre class="brush: plain; title: ; notranslate">alias Purge=”sudo apt-get remove –purge”</pre>
<p>and so on&#8230;</p>
<h2>A Very Interesting ‘alias’ For A Difficult Keyboard Button</h2>
<p>On  some keyboards, the dot (.) button is at very difficult position and if  you have to use it more than once, it becomes even more difficult.  That’s why ‘cd ..’ is the command which I mistype the most.  This  complication can be easily removed by using following ‘alias’ (you  can use any other word instead of a dot):</p>
<pre class="brush: plain; title: ; notranslate">alias .=”cd ..”</pre>
<pre class="brush: plain; title: ; notranslate">alias ..=”cd ../..”</pre>
<pre class="brush: plain; title: ; notranslate">alias ...=”cd ../../..”</pre>
<pre class="brush: plain; title: ; notranslate">alias ....=”cd ../../../..”</pre>
<h2>Using Internet From Terminal</h2>
<p>If you regularly use <a href="http://lynx.isc.org/" onclick="return TrackClick('http%3A%2F%2Flynx.isc.org%2F','lynx')">lynx</a> to browse the internet in terminal then you have to type long urls with  lynx to visit the web pages.  You can simplify these long urls by using  ‘alias’:</p>
<pre class="brush: plain; title: ; notranslate">alias Google=”lynx http://www.google.com/”</pre>
<pre class="brush: plain; title: ; notranslate">alias Yahoo=”lynx http://www.yahoo.com/”</pre>
<pre class="brush: plain; title: ; notranslate">alias yalb =”lynx http://linux-blog.org/”</pre>
<p>and so on&#8230;</p>
<p>Now just type Google, Yahoo or yalb to visit the respective web sites.</p>
<h2>Simple &#8216;alias&#8217; For More Complicated Commands</h2>
<p>Long  commands are not only difficult to remember but also take more time to  type; when you have to use them on daily basis, you become frustrated  when typing them again and again and again&#8230; So, &#8216;alias&#8217; are more  suitable for long and complicated commands.</p>
<p>Let&#8217;s consider an example.</p>
<p>To find the top 10 largest files in your system, you can set the following ‘alias’:</p>
<pre class="brush: plain; title: ; notranslate">alias top10files=”find . -type f -exec ls -sh {} \; | sort -n -r | head -10”</pre>
<p>You  can even mix different commands with ‘alias’.  For instance, if you  regularly use &#8216;tail&#8217; and direct its output to file to later view that  file, you can set a very simple ‘alias’ to do this cumbersome operation  in 1 word:</p>
<pre class="brush: plain; title: ; notranslate">alias Tail=”tail /var/log/messages &gt; hello.txt;cat hello.txt”</pre>
<p>Now just enter &#8216;Tail&#8217; and viola! All is done at once.</p>
<p>You can use any file with tail and direct its output and you can even use &#8216;nano&#8217; or &#8216;vi&#8217; to view/edit its output.</p>
<p>Here’s another example&#8230; ‘alias’ to connect to a remote server:</p>
<pre class="brush: plain; title: ; notranslate">alias any_name=”ssh &lt;remote_server_address&gt; -l &lt;username&gt; -p &lt;port&gt;”</pre>
<p>You can even create ‘alias’ for your bash scripts, like:</p>
<pre class="brush: plain; title: ; notranslate">alias clc=”sh /home/user/myscripts/calc.sh”</pre>
<p>Now that you have set a few different ‘alias’  you might want to check that which &#8216;alias&#8217; are set on your system.  To do that, just issue the following command:</p>
<pre class="brush: plain; title: ; notranslate">alias</pre>
<p>and it will list all the set ‘alias’ you have.</p>
<p>To remove an ‘alias’, just issue the &#8216;unalias&#8217; command, like:</p>
<pre class="brush: plain; title: ; notranslate">unalias Google</pre>
<p>and now typing Google in terminal will do nothing (as it was set with lynx).</p>
<p>To remove all the &#8216;alias&#8217;, issue the following command and all the ‘alias’ are gone:</p>
<pre class="brush: plain; title: ; notranslate">unalias –a</pre>
<p>We  have discussed the way of setting the ‘alias’ for different kinds of  commands.  But setting ‘alias’ in this way be temporary.  When you reboot  you PC, all the ‘alias’ which you have set will be gone.  This does not  mean that you have to set all the ‘alias’ every time you boot your PC.  If you have set an ‘alias’ and you liked it so much that you want it to  permanently reside in you PC, just add this alias in ‘.bashrc’ file in  you home directory. For example, if you want ‘alias’:</p>
<p>Install &lt;software_name&gt;</p>
<p>to permanently reside in your PC then user your favorite text editor and add the following line in your ‘~/.bashrc’ file:</p>
<pre class="brush: plain; title: ; notranslate">alias Install=”sudo apt-get install”</pre>
<p>Now  this ‘alias’ will not vanish into thin air when you reboot your PC. Only  those ‘alias’  which are listed in ‘~/.bashrc’ file will be permanent.</p>
<p>This <a href="http://readalquran.org" onclick="return TrackClick('http%3A%2F%2Freadalquran.org','guide')" target="_blank"> guide </a>is just a preview about ‘alias’.  It is just about basic ways of  using ‘alias’ to make your life simpler.  ‘GNU  alias’ is a tool which can simplify your life immensely.  But  unfortunately this tool is not given the attention it deserves.  In  short, it is such a powerful tool that if you give it proper time, it  can make you forget typing <img src='http://linux-blog.org/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><a href="http://linux-blog.org/using-alias-in-linux/" rel="bookmark">Using &#8216;Alias&#8217; in Linux</a> originally appeared on <a href="http://linux-blog.org">Yet Another Linux Blog</a> on December 23, 2010.</p>
]]></content:encoded>
			<wfw:commentRss>http://linux-blog.org/using-alias-in-linux/feed/</wfw:commentRss>
		<slash:comments>18</slash:comments>
		</item>
		<item>
		<title>GNU find &#8211;  A Multidimensional Tool</title>
		<link>http://linux-blog.org/gnu-find-a-multidimensional-tool/</link>
		<comments>http://linux-blog.org/gnu-find-a-multidimensional-tool/#comments</comments>
		<pubDate>Thu, 25 Nov 2010 03:30:09 +0000</pubDate>
		<dc:creator>usama</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[cli]]></category>
		<category><![CDATA[new users]]></category>
		<category><![CDATA[tips and tricks]]></category>

		<guid isPermaLink="false">http://linux-blog.org/?p=1756</guid>
		<description><![CDATA[Beginners are mostly afraid of command prompt.  Whenever they see a command prompt, they immediately say “its very difficult”.  But it’s not true.  The Command prompt is as friendly as GUI (Graphical User Interface), provided if you use it with proper procedure. Most people use GUI tools to search for files.  They don&#8217;t realize that [...]]]></description>
			<content:encoded><![CDATA[<p>Beginners  are mostly afraid of command prompt.  Whenever they see a command  prompt, they immediately say “its very difficult”.  But it’s not true.   The Command prompt is as friendly as GUI (Graphical User Interface),  provided if you use it with proper procedure.</p>
<p>Most people use GUI tools to search for files.  They don&#8217;t realize  that they can use command line tools to search for them as well! GNU  &#8216;find&#8217; is such like a tool which can not only search files but can even  copy, move or delete these files on the fly.</p>
<p>So let’s see that how &#8216;find&#8217; works.</p>
<h3>Find Your Lost Files!</h3>
<p>Let&#8217;s start from a simple example:</p>
<p>Suppose you want to search for a file named<em> &#8216;master.txt&#8217;</em> in your home directory.</p>
<p>Open the Terminal and issue the following command:</p>
<pre class="brush: plain; title: ; notranslate">find . -name “master.txt”</pre>
<p>&#8216;find&#8217;  will immediately show the results.  If &#8216;find&#8217; does not show any result,  this means that the file, in our case,<em> &#8216;master.txt&#8217;, </em>does not exist.  It  is not always the case that you want to find something in you home  directory.  The lost/desired file may be anywhere in your computer.  Suppose  you want to find a file named <em>&#8216;space-01.jpg&#8217;</em> and you only know that its  located somewhere in<em> /usr</em> directory. You can find it by issuing  following command in Terminal:</p>
<pre class="brush: plain; title: ; notranslate">find /usr -name “space-01.jpg”</pre>
<p>and &#8216;find&#8217; will tell you that this is located under <em>/usr/share/backgrounds</em>.</p>
<h3>Using Wildcards</h3>
<p>Maybe you want to search for a file but you don&#8217;t know its exact name?  Don&#8217;t  worry!  You can still locate the file using &#8216;GNU find&#8217; and wildcard will  help you in this regard. Wildcards are a way of searching files when you  don&#8217;t know much about your desired file.</p>
<p>One of the commonly used wildcard is asterisk (*).  Lets consider an example to better understand the things.</p>
<p>Suppose  you want to search a file named <em>&#8216;Jumping_Flowers&#8217;</em> but you only remember  the &#8216;<em>Jumping</em>&#8216; part of the file name.  So issue the following command in  Terminal:</p>
<pre class="brush: plain; title: ; notranslate">find . -name “Jumping*”</pre>
<p>And it will display all the files starting with the word <em>&#8216;Jumping&#8217;</em>.  You can use asterisk (*) anywhere with a file name.  For example:</p>
<pre class="brush: plain; title: ; notranslate">find . -name “*Jumping*”</pre>
<p>And it will display all the files which contains the word<em> &#8216;Jumping&#8217;</em>.</p>
<p>Here are some more examples of use of a wildcard:</p>
<pre class="brush: plain; title: ; notranslate">find . -name “Jumping*Flowers*”</pre>
<pre class="brush: plain; title: ; notranslate">find . -name “*Jumping*Flowres.mp3”</pre>
<h3>Searching For Different File Types</h3>
<p>Sometimes  you are not looking for some specific file but you are looking for a  group of files.  For example, you may be looking for all the .txt files  in your home directory.  To find all the .txt files, you will give the following command in Terminal:</p>
<pre class="brush: plain; title: ; notranslate">find . -name *.txt</pre>
<p>In case of mp3 files, the above command will be:</p>
<pre class="brush: plain; title: ; notranslate">find . -name *.mp3</pre>
<h3>When You Want to Search with Respect to Time</h3>
<p>If you want to search for files by the last time they were accessed, you can use <em>-amin</em> flag with &#8216;find&#8217;.  In this case you have to put a minus (-) sign  before the time.  The time here is in minutes.  In order to search for  .doc files which were accessed in last 10 minutes, you will give the  following command:</p>
<pre class="brush: plain; title: ; notranslate">find . -amin -10 -name &quot;*.doc&quot;</pre>
<p>Similarly, to search for .doc files which were modified in last 20 minutes, you will use <em>-mmin</em> option as follows:</p>
<pre class="brush: plain; title: ; notranslate">find . -mmin -20 -name “*.doc”</pre>
<h3>Search For Files which are Eating Your Hard Disk</h3>
<p>There  may be files on your system which are not only huge in size but also  located obscure places.  You may also may not know when they were last  accessed.  You have to use -size option with &#8216;find&#8217; to locate them.</p>
<p>Let&#8217;s see how we can do this:</p>
<pre class="brush: plain; title: ; notranslate">find . -size +100M</pre>
<p>It  will list all those files which are greater than 100 Megabytes.  You can  replace &#8216;M&#8217; with &#8216;G&#8217; (for Gigabyte) or with &#8216;k&#8217; (for Kilobyte)</p>
<h3>Copy, Move, or Delete Unwanted Files on the Fly</h3>
<p><strong>Copy</strong> &#8211; &#8216;find&#8217;  can also be used to copy or backup your files.  You can use &#8216;find&#8217; to  copy certain files from one location to other with one simple command.</p>
<p>Suppose  you want copy all of your mp3 songs from your home directory to your  Windows Partition.  Enter the following command in Terminal:</p>
<pre class="brush: plain; title: ; notranslate">find . -name &quot;*.mp3&quot; -exec cp {} /path/to/Windows_Drive \;</pre>
<p>And all of your mp3 files will be copied to the desired Drive/Folder.</p>
<p><strong>Move</strong> – There  may be situations that you quickly want to move all of your document  files from your Hard Disk to your USB to keep them safe.  To move all of  your documents from your home directory to your USB, you will issue the  following command:</p>
<pre class="brush: plain; title: ; notranslate">find . -name &quot;*.doc&quot; -exec cp {} /path/to/USB \;</pre>
<p><strong>Delete</strong> &#8211;  Suppose there are a lot of .tmp files and you want to get rid of them  at once.  Again &#8216;GNU find&#8217; is at your service and does the work for you.   Issue the following in Terminal and all of the .tmp files are gone&#8230;</p>
<pre class="brush: plain; title: ; notranslate">find . -name '*.tmp' -exec rm {} \;</pre>
<h3>Which Files are Owned by You and Which Are Not?</h3>
<p>There  may be a situation when you want to know that which files in some other  directories (or even in your home directory) are owned by some other  user of your computer.</p>
<p>Suppose  there is another user named &#8216;blackstar&#8217; with whom you are sharing your  PC.  Now you want to know that which .doc files in Windows Directory is  owned by this user &#8216;blackstar&#8217;.  You can do this by issuing the following  command:</p>
<pre class="brush: plain; title: ; notranslate">find /path/to/Windows_Drive -user blackstar -name “*.doc”</pre>
<p>Just replace &#8216;blackstar&#8217; with your username to search on your system.</p>
<h3>Direct the Output of &#8216;find&#8217; to a File</h3>
<p>You  can save the results of your &#8216;find&#8217; command to a text file which will  allow you to examine the results in detail at some later time (or to  create playlist of your songs).  For this purpose a greater than (&gt;) sign is used (referred to as &#8220;piping the command&#8221;).</p>
<p>Suppose  you want to save the list of all the mp3 songs in your home directory  to a text file (which you can later share with your friend), you can do  this by:</p>
<pre class="brush: plain; title: ; notranslate">find . -name &quot;*.mp3&quot; &gt; mp3.txt</pre>
<p>It will save the complete path to all of your mp3 songs in the file named <em>mp3.txt</em>.</p>
<h3>Find, a Handy Command Line Tool</h3>
<p>This  article is basically directed towards new users of Linux which are not  much familiar with command prompt. This is a small but comprehensive  article about &#8216;GNU find&#8217; . The man pages of &#8216;find&#8217; list a huge number of  options which are difficult to explain in detail in one small article. I  tried to cover those option which are commonly used. Obviously, to know  more about such a powerful tool , one has to visit its man <a href="http://readalquran.org" onclick="return TrackClick('http%3A%2F%2Freadalquran.org','pages')" target="_blank">pages</a> again  and again and spend a lot time with &#8216;find&#8217; <img src='http://linux-blog.org/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><a href="http://linux-blog.org/gnu-find-a-multidimensional-tool/" rel="bookmark">GNU find &#8211;  A Multidimensional Tool</a> originally appeared on <a href="http://linux-blog.org">Yet Another Linux Blog</a> on November 24, 2010.</p>
]]></content:encoded>
			<wfw:commentRss>http://linux-blog.org/gnu-find-a-multidimensional-tool/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Linux File Permissions, Groups, and Users</title>
		<link>http://linux-blog.org/linux-file-permissions-groups-and-users/</link>
		<comments>http://linux-blog.org/linux-file-permissions-groups-and-users/#comments</comments>
		<pubDate>Thu, 04 Nov 2010 01:28:37 +0000</pubDate>
		<dc:creator>devnet</dc:creator>
				<category><![CDATA[Featured]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[chgrp]]></category>
		<category><![CDATA[chmod]]></category>
		<category><![CDATA[chown]]></category>
		<category><![CDATA[desktop]]></category>
		<category><![CDATA[groups]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[permissions]]></category>
		<category><![CDATA[tips and tricks]]></category>

		<guid isPermaLink="false">http://linux-blog.org/?p=887</guid>
		<description><![CDATA[Why Are Permissions Important? Permissions are important for keeping your data safe and secure.   Utilizing permission settings in Linux can benefit you and those you want to give access to your files and you don&#8217;t need to open up everything just to share one file or directory (something Windows sharing often does).  You can group [...]]]></description>
			<content:encoded><![CDATA[<h3>Why Are Permissions Important?</h3>
<p>Permissions are important for keeping your data safe and secure.   Utilizing permission settings in Linux can benefit you and those you want to give access to your files and you don&#8217;t need to open up everything just to share one file or directory (something Windows sharing often does).  You can group individual users together and change permissions on folders (called directories in Linux) and files and you don&#8217;t have to be in the same OU or workgroup or be part of a domain for them to access those files.  You can change permissions on one file and share that out to a single group or multiple groups.  Fine grained security over your files places you in the driver seat in control of your own data.</p>
<p>Some will argue that it may be too much responsibility&#8230;that placing this onto the user is foolish and other aforementioned operating systems don&#8217;t do this.  You&#8217;d be right&#8230;XP doesn&#8217;t do this.  However, Microsoft saw what Linux and Unix do with the <a title="Principle of Least Privilege" href="http://en.wikipedia.org/wiki/Least_user_access" onclick="return TrackClick('http%3A%2F%2Fen.wikipedia.org%2Fwiki%2FLeast_user_access','Principle+of+Least+Privilege')" target="_blank">principle of least privilege</a> and have copied this aspect from them.  While the NTFS filesystem employs user access lists with workgroups and domains&#8230;it cannot mirror the fine grained, small scale security of Linux for individual files and folders.  For the home user, Linux empowers control and security.</p>
<p>I&#8217;m going to go over how users and directory/file permissions work.  So, let&#8217;s setup an example that will allow us to explore file permissions.  If you have any questions, just ask it in the comments section at the end of the article.</p>
<h2>File Permissions Explained</h2>
<p><a href="http://linux-blog.org/wp-content/uploads/2009/09/permissions.png" onclick="return TrackClick('http%3A%2F%2Flinux-blog.org%2Fwp-content%2Fuploads%2F2009%2F09%2Fpermissions.png','permissions')"><img class="size-full wp-image-1223 alignleft" style="padding-right: 5px;" title="permissions" src="http://linux-blog.org/wp-content/uploads/2009/09/permissions.png" onclick="return TrackClick('http%3A%2F%2Flinux-blog.org%2Fwp-content%2Fuploads%2F2009%2F09%2Fpermissions.png','permissions')" alt="permissions" width="358" height="282" /></a>The picture to your left is a snapshot of my $HOME directory.  I&#8217;ve included this &#8220;legend&#8221; to color code and label the various columns.  Let&#8217;s go through the labels and names of things first and then work on understanding how we can manipulate them in the next section.</p>
<p>As noted in the picture, the first column (orange) explains whether or not the contents listed is a directory or not.  If any of these happened NOT to be a directory, a dash (-) would be in place of the d at the beginning of the listing on the far left.</p>
<p>In the second, third, and fourth column (Green, Blue and Red) we find permissions.  Looking at the gray box in the bottom-right corner gives us an explanation of what each letter represents in our first few columns.  These tell us whether or not each user, group, or other (explained in detail later in this article) have read, write, and execute privileges for the file or folder/directory.</p>
<p>In the 5th column (white) the number of hard links is displayed.  This column shows the number of actual physical hard links.  A hard link is a directory reference, or pointer, to a file on a storage volume that is a specific location of physical data.  <a title="hard links explained" href="http://www.cyberciti.biz/tips/understanding-unixlinux-symbolic-soft-and-hard-links.html" onclick="return TrackClick('http%3A%2F%2Fwww.cyberciti.biz%2Ftips%2Funderstanding-unixlinux-symbolic-soft-and-hard-links.html','hard+links+explained')" target="_blank">More information on hard links vs. symbolic (soft) links can be found here.</a></p>
<p>In column 6 (light blue) we find the user/owner of the file/directory.  In column 7 (gray blue), the <em>group</em> that has access to the file/folder is displayed.  In column 8 (pink), the size of the file or folder is shown in kilobytes.  In column 9 (fluorescent green), the last date the file or folder was altered or touched is shown.  In column 10 (grey), the file or directory name is displayed.</p>
<p>We&#8217;re going to pay specific attention to the first four columns in the next section and then follow that up by working with the sixth and seventh by going over user/owner and group.  Let&#8217;s move on to go over all of those rwx listings and how we can make them work for us.</p>
<h2>Read, Write, Execute &#8211; User, Group, Other</h2>
<p>First, let&#8217;s go over what different permissions mean.  Read permission means you can view the contents of a file or folder.  Write permission means you can write to a file or to a directory (add new files, new subdirectories) or modify a file or directory.  Execute permission means that you can change to a directory and execute ( or run ) a file or script for that file or directory.</p>
<p>The User section shown in green in the picture above shows whether or not the user can perform the actions listed above.  If the letter is present, the user has the ability to perform that action.  The same is true for the Group shown in blue above&#8230;if a member of the group that has access to the file or directory looks in this column, they will know what they can or can&#8217;t do (read,write, or execute).  Lastly, all others (noted in the red column above).  Do all others have read, write, and execute permissions on the file or folder?  This is important for giving anonymous users access to files in a file server or web server environment.</p>
<p>You can see how fine grained you might be able to set things up with&#8230;For example, you may give users read only access while allowing a group of 5 users full control of the file or directory.  You may want to switch that around.  It&#8217;s entirely up to you how you want to setup permissions.</p>
<h2>More about Groups</h2>
<p>Let&#8217;s go through setting up a group and adding a few users to it and then assigning that group permissions to access a directory and file.</p>
<p>Create a file inside your home directory by opening up a shell or terminal and typing:</p>
<pre class="brush: plain; title: ; notranslate">touch ~/example.txt</pre>
<p>You&#8217;ve now created a file called example.txt inside your home directory.  If you are already there, you can list the contents with the &#8216;ls&#8217; command.  Do that now.  If you&#8217;re not already there, type &#8216;cd ~/&#8217; and you will be taken to your home directory where you can &#8216;ls&#8217; list the files.  It should look similar to the following:</p>
<pre class="brush: plain; title: ; notranslate">[devnet@lostlap ~]$ ls -l
total 40
drwxr-xr-x  2 devnet devnet 4096 2010-05-24 17:04 Desktop
drwxr-xr-x  6 devnet devnet 4096 2010-05-24 13:10 Documents
drwxr-xr-x  9 devnet devnet 4096 2010-05-27 15:25 Download
-rw-rw-r--  1 devnet devnet    0 2010-05-28 10:21 example.txt
drwxr-xr-x 13 devnet devnet 4096 2010-05-26 16:48 Music
drwxr-xr-x  3 devnet devnet 4096 2010-05-24 13:09 Pictures
drwxr-xr-x  3 devnet devnet 4096 2010-05-24 13:04 Videos
</pre>
<p>Next up, let&#8217;s create a new group and a couple of new users.  After creating these we&#8217;ll assign the users to the new group.  After that, we&#8217;ll move the file and lock it down to the new group only.  If everything works as planned, the file should be accessible to root and the other 2 users but NOT accessible to your current user.  You&#8217;ll need to be root for all of these commands (or use sudo for them).  Since I have sudo and don&#8217;t want to continually type sudo, I used the command &#8220;sudo -s&#8221; and entered my root password to permanently log in as root in a terminal for the duration of this how-to.  OK, Let&#8217;s get started:</p>
<pre class="brush: plain; title: ; notranslate">
[root@lostlap ~]$ useradd -m -g users -G audio,lp,optical,storage,video,wheel,games,power -s /bin/bash testuser1
[root@lostlap ~]$ useradd -m -g users -G audio,lp,optical,storage,video,wheel,games,power -s /bin/bash testuser2
</pre>
<p>The above commands will create two users that should be pretty close to your current logged in user (as far as group membership goes).  If the groups you&#8217;re adding the user to do not exist, you may get a warning that the groups don&#8217;t exist&#8230;no worries, just continue.  If the above commands don&#8217;t work on your system (I used Arch Linux to do this) then you can use the GUI elements to manage users and add a new one.  You won&#8217;t need to add them to any extra groups since we just need a basic user.  Next, let&#8217;s create our &#8216;control&#8217; group.</p>
<pre class="brush: plain; title: ; notranslate">
[root@lostlap ~]$ groupadd testgroup
</pre>
<p>The above command creates the &#8216;testgroup&#8217; group.  Now let&#8217;s add the two users we created to this group.</p>
<pre class="brush: plain; title: ; notranslate">
[root@lostlap ~]$ gpasswd -a testuser1 testgroup
[root@lostlap ~]$ gpasswd -a testuser2 testgroup
</pre>
<p>The command above adds both our test users to the test group we created.  Now we need to lock the file down so that only those users inside of &#8216;testgroup&#8217; can access it.  Since your current logged in user is NOT a member of &#8216;testgroup&#8217; then you shouldn&#8217;t be able to access the file once we lock access to that group.</p>
<pre class="brush: plain; title: ; notranslate">
[root@lostlap ~]$ chgrp testgroup example.txt
</pre>
<p>The above command changes the group portion of file permission (discussed earlier) from a group your currently logged in user is a member of to our new group &#8216;testgroup&#8217;.  We still need to change the owner of the file so a new terminal opened up as your current user won&#8217;t be the owner of example.txt.  To do this, let&#8217;s assign example.txt a new owner of Testuser2.</p>
<pre class="brush: plain; title: ; notranslate">[root@lostlap ~]$ chown testuser2 example.txt</pre>
<p>Now when you try to access the file example.txt you won&#8217;t be able to open it up as your standard user (root still will be able to access it) because you don&#8217;t have the permissions to do so.  To test this, open up a new terminal (one where you are not root user) and use your favorite text editor and try to open up example.txt.</p>
<pre class="brush: plain; title: ; notranslate">
[devnet@lostlap ~]$ nano example.txt
</pre>
<p>Both <em>testuser1</em> and <em>testuser2</em> will be able to access example.txt because testuser2 owns the file and testuser1 is in the testgroup that has access to this file.  However, your current logged in user will also have READ rights to it but will not be able to access it.  Why?  Let&#8217;s take a look at the permissions on example.txt</p>
<pre class="brush: plain; title: ; notranslate">[devnet@lostlap ~]$ ls -l example.txt
-rw-r--r-- 1 testuser1 testgroup 8 2010-05-28 10:21 example.txt</pre>
<p>Notice that the user, group, and other (1st, 2nd, and 3rd position of r,w,x &#8211; see the handy diagram I made above) have permissions assigned to them.  The user can read and write to the file.  The group can read it.  Others can also read it.  So let&#8217;s remove a permission to lock this file down.  Go back to your root terminal that is open or &#8216;sudo -s&#8217; to root again and do the following:</p>
<pre class="brush: plain; title: ; notranslate">[root@lostlap ~]$ chmod o-r example.txt</pre>
<p>Now go back to your user terminal and take a look at the file again:</p>
<pre class="brush: plain; title: ; notranslate">[devnet@lostlap ~]$ ls -l example.txt
-rw-r----- 1 testuser1 testgroup 8 2010-05-28 10:21 example.txt</pre>
<p>Once that has been accomplished, try and open the file with your favorite text editor as your currently logged in user (devnet for me):</p>
<pre class="brush: plain; title: ; notranslate">[devnet@lostlap ~]$ nano example.txt</pre>
<p>Your user now should get a permission denied error by nano (or whatever text editor you used to open it).  This is how locking down files and directories works.  It&#8217;s very granular as you can give read, write, and execute permissions to individual users, groups of users, and the general public.  I&#8217;m sure most of you have seen permissions commands with 777 or 644 and you can use this as well (example, chmod 666 filename) but please remember you can always use the chmod ugo+rwx or ugo-rwx as a way to change the permissions as well.  I liked using letters as opposed to the numbers because it made more sense to me&#8230;perhaps you&#8217;ll feel the same.</p>
<p>Hopefully you now have a general understanding how groups, users and permissions work and can appreciate how the complexity of it is also elegant at the same time.  If you have questions, please fire away in the comments section.  Corrections?  Please let me know!  Thanks for reading!</p>
<p><a href="http://linux-blog.org/linux-file-permissions-groups-and-users/" rel="bookmark">Linux File Permissions, Groups, and Users</a> originally appeared on <a href="http://linux-blog.org">Yet Another Linux Blog</a> on November 3, 2010.</p>
]]></content:encoded>
			<wfw:commentRss>http://linux-blog.org/linux-file-permissions-groups-and-users/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>ICH6 Intel Sound on Unity or Mandriva PulseAudio Fix</title>
		<link>http://linux-blog.org/ich6-intel-sound-on-unity-or-mandriva-pulseaudio-fix/</link>
		<comments>http://linux-blog.org/ich6-intel-sound-on-unity-or-mandriva-pulseaudio-fix/#comments</comments>
		<pubDate>Fri, 22 Oct 2010 05:02:51 +0000</pubDate>
		<dc:creator>devnet</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[mandriva]]></category>
		<category><![CDATA[tips and tricks]]></category>
		<category><![CDATA[unity]]></category>

		<guid isPermaLink="false">http://linux-blog.org/?p=1726</guid>
		<description><![CDATA[I had been fighting for a very long time with pulseaudio on Unity Linux 2010&#8230;it just didn&#8217;t seem to work for me.  There were problems with having to mute and unmute the external amplifier channel in alsamixer in order to get sound to work.  On some boots there was no sound and on others, sound [...]]]></description>
			<content:encoded><![CDATA[<p>I had been fighting for a very long time with pulseaudio on Unity Linux 2010&#8230;it just didn&#8217;t seem to work for me.  There were problems with having to mute and unmute the external amplifier channel in alsamixer in order to get sound to work.  On some boots there was no sound and on others, sound was fine.  When I finally installed TinyMe 2010 RC last week, I disabled pulseaudio all together to get the sound working with ALSA only.</p>
<p>Then the worst thing that could possibly happen on my Gateway M250 happened&#8230;ALSA stopped working and there was no sound.  I started pulseaudio back up to no avail&#8230;no matter what I did, nothing worked to get sound up and running.</p>
<p>It was about the time I wanted to carve the sound pieces out of my laptop and throw them across the room that I decided to give everything I tried in the past <strong>one more try.</strong></p>
<p>I fixed it&#8230;and I was pretty amazed that the solution was as easy as it was having spent weeks upon weeks fighting the pulseaudio issue.  I can only surmise that I made a typo in the module that I needed to blacklist.  After this arduous journey, it came down to blacklisting the modem sound card to make things work.</p>
<p>To do this on Mandriva and Unity Linux you&#8217;ll need to blacklist the following module:  snd_intel8x0m.  Notice the &#8216;m&#8217; on the end of the standard module snd_intel8x0 for the ICH6 sound card.</p>
<p>You can do this by editing the following file as root in your favorite text editor:  <em>/etc/modprobe.d/blacklist-compat</em></p>
<p>Add the following line anywhere in this file:</p>
<p><class ="notranslate">
<pre class="brush: plain; title: ; notranslate">blacklist snd_intel8x0m</pre>
<p></class></p>
<p>After that, you can reboot to make sure the module is blacklisted.  I know there are more elegant ways to load and unload kernel modules but this is the easiest way to get the job done for new users.  Subsequent reboots resulted in still having sounds.  Thankfully, I didn&#8217;t have to rip my laptop apart in a quest to throw the sound portions.  I sure hope this helps others out!</p>
<p><a href="http://linux-blog.org/ich6-intel-sound-on-unity-or-mandriva-pulseaudio-fix/" rel="bookmark">ICH6 Intel Sound on Unity or Mandriva PulseAudio Fix</a> originally appeared on <a href="http://linux-blog.org">Yet Another Linux Blog</a> on October 22, 2010.</p>
]]></content:encoded>
			<wfw:commentRss>http://linux-blog.org/ich6-intel-sound-on-unity-or-mandriva-pulseaudio-fix/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Midori, Flash, and Unity Linux 2010</title>
		<link>http://linux-blog.org/midori-flash-and-unity-linux-2010/</link>
		<comments>http://linux-blog.org/midori-flash-and-unity-linux-2010/#comments</comments>
		<pubDate>Wed, 08 Sep 2010 19:13:08 +0000</pubDate>
		<dc:creator>devnet</dc:creator>
				<category><![CDATA[Distros]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[2010]]></category>
		<category><![CDATA[help]]></category>
		<category><![CDATA[midori]]></category>
		<category><![CDATA[tricks]]></category>
		<category><![CDATA[unity]]></category>
		<category><![CDATA[unity linux]]></category>

		<guid isPermaLink="false">http://linux-blog.org/?p=1683</guid>
		<description><![CDATA[I just took a look at how Unity Linux 2010.1 shapes up and found that the flashplayer plugin doesn&#8217;t work with the default browser which is Midori.  Here&#8217;s a quick fix for getting flash to work with Midori on Unity 2010.  First, install the flash-player-plugin (as root in terminal or use the gui): Next, we [...]]]></description>
			<content:encoded><![CDATA[<p>I just took a look at how Unity Linux 2010.1 shapes up and found that the flashplayer plugin doesn&#8217;t work with the default browser which is Midori.  Here&#8217;s a quick fix for getting flash to work with Midori on Unity 2010.  First, install the flash-player-plugin (as root in terminal or use the gui):</p>
<pre class="brush: plain; title: ; notranslate">smart install flash-player-plugin</pre>
<p>Next, we need to create a directory under your profile to house the flashplayer plugin and then copy it there.  I&#8217;m sure we might be able to get by with a symbolic link but I didn&#8217;t try that out&#8230;</p>
<pre class="brush: plain; title: ; notranslate">mkdir -p ~/.mozilla/plugins &amp;&amp; ﻿cp /usr/lib/mozilla/plugins/libflashplayer.so ~/.mozilla/plugins/</pre>
<p>That&#8217;s it, it should work now.  I&#8217;ve done this on 32bit Unity Linux 2010.1 on a Gateway M250.  Hopefully this helps out someone out there <img src='http://linux-blog.org/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><a href="http://linux-blog.org/midori-flash-and-unity-linux-2010/" rel="bookmark">Midori, Flash, and Unity Linux 2010</a> originally appeared on <a href="http://linux-blog.org">Yet Another Linux Blog</a> on September 8, 2010.</p>
]]></content:encoded>
			<wfw:commentRss>http://linux-blog.org/midori-flash-and-unity-linux-2010/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Finding Files with locate</title>
		<link>http://linux-blog.org/finding-files-with-locate/</link>
		<comments>http://linux-blog.org/finding-files-with-locate/#comments</comments>
		<pubDate>Tue, 07 Sep 2010 16:52:06 +0000</pubDate>
		<dc:creator>devnet</dc:creator>
				<category><![CDATA[Tips]]></category>
		<category><![CDATA[cli]]></category>
		<category><![CDATA[command line]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[shell]]></category>
		<category><![CDATA[tips and tricks]]></category>

		<guid isPermaLink="false">http://linux-blog.org/?p=1666</guid>
		<description><![CDATA[Many Linux users use the &#8216;find&#8217; utility when searching for files using the command line on their system. They&#8217;ll do a simple: Really though, the power of find isn&#8217;t just in finding names of files but rather specific details about those files. For example, if you wanted to find files which are writable by both [...]]]></description>
			<content:encoded><![CDATA[<p>Many Linux users use the &#8216;find&#8217; utility when searching for files using the command line on their system.  They&#8217;ll do a simple:</p>
<pre class="brush: plain; title: ; notranslate">find / -name 'pattern'</pre>
<p>Really though, the power of find isn&#8217;t just in finding names of files but rather specific details about those files.  For example, if you wanted to find files which are writable by both their owner and their group:</p>
<pre class="brush: plain; title: ; notranslate">find / -perm -444 -perm /222 ! -perm /111</pre>
<p>or perhaps find any file that&#8217;s been altered in your Download directory in the past 24 hours:</p>
<pre class="brush: plain; title: ; notranslate">find /home/user/Downloads/ -mtime 0</pre>
<p>As you can see, the find command is very versatile and can be used to find an array of different attributes of files.  There are times though where I&#8217;m just looking for something and I don&#8217;t want to have to wait for the command to scan the entire directory tree in order to track it down.  That&#8217;s where locate comes in with quick and simple results.</p>
<h3>Using the Locate Command</h3>
<p>Using the locate command can only be accomplished if you install the mlocate package.  Most major distributions have this available.  If not, <a title="mlocate homepage" href="http://carolina.mff.cuni.cz/~trmac/blog/mlocate/" onclick="return TrackClick('http%3A%2F%2Fcarolina.mff.cuni.cz%2F%7Etrmac%2Fblog%2Fmlocate%2F','mlocate+homepage')" target="_blank">head over to the mlocate homepage</a> and install manually.  Once that is accomplished, you&#8217;ll need to manually run a command to index your filesystem with it&#8230;otherwise, you&#8217;ll have to wait for the command to run automatically as it registers with cron to do so on a system level.  Open an terminal and change to your root user, then execute the following:</p>
<pre class="brush: plain; title: ; notranslate">updatedb &amp;</pre>
<p>This updates the mlocate database that indexes your files and forks it to the background (the &#8216;&amp;&#8217; forks it to the background).  You can now logout of the terminal as root and the process will quietly work in the background.</p>
<p>After the command completes, using mlocate is as easy as using the locate command:</p>
<pre class="brush: plain; title: ; notranslate">locate firefox | less</pre>
<p>The command above will look for all files with firefox in the name and pipe the command through less so you can use the spacebar or enter key to scroll the file buffer.  Of course, the reason we pipe it through less is because any file that resides in the &#8216;firefox&#8217; directory will be reported in the output.  While this tool isn&#8217;t as granular as the find command, it is a quick way to track down paths, directories, and files you know should exist.  Since the data is indexed using the updatedb command (by cron) the results are very quick and the command does not have to scan through the filesystem to return the results.</p>
<p>There are plenty more advanced options via flags (such as following symbolic links, making search term case sensitive, and even using regexp).  See the man page for details on how each of these options work.  Play around with locate and see what you can do!  It&#8217;s a powerful and quick search command!</p>
<p><a href="http://linux-blog.org/finding-files-with-locate/" rel="bookmark">Finding Files with locate</a> originally appeared on <a href="http://linux-blog.org">Yet Another Linux Blog</a> on September 7, 2010.</p>
]]></content:encoded>
			<wfw:commentRss>http://linux-blog.org/finding-files-with-locate/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Page Caching using disk: enhanced
Database Caching 23/121 queries in 0.737 seconds using disk: basic
Object Caching 1296/1438 objects using disk: basic

Served from: linux-blog.org @ 2012-05-23 05:44:31 -->
