<?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 Blog &#187; cli</title>
	<atom:link href="http://linux-blog.org/tag/cli/feed/" rel="self" type="application/rss+xml" />
	<link>http://linux-blog.org</link>
	<description>Open Source, Open Blog</description>
	<lastBuildDate>Fri, 03 Feb 2012 14:33:43 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
		<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 [...]
No related posts.

Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.]]></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>No related posts.</p>
<p>Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.</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>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 [...]
No related posts.

Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.]]></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" target="_blank">tutorial </a>gets you started chasing your tail!</p>
<p>No related posts.</p>
<p>Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.</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 [...]
No related posts.

Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.]]></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/">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" 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>No related posts.</p>
<p>Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.</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 [...]
No related posts.

Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.]]></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" 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>No related posts.</p>
<p>Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.</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>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 [...]
No related posts.

Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.]]></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/" 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>No related posts.</p>
<p>Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.</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>
		<item>
		<title>Convert PNG to GIF via Command Line</title>
		<link>http://linux-blog.org/convert-png-to-gif-via-command-line/</link>
		<comments>http://linux-blog.org/convert-png-to-gif-via-command-line/#comments</comments>
		<pubDate>Fri, 06 Nov 2009 18:24:03 +0000</pubDate>
		<dc:creator>devnet</dc:creator>
				<category><![CDATA[Featured]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[cli]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[shell]]></category>
		<category><![CDATA[tips and tricks]]></category>

		<guid isPermaLink="false">http://linux-blog.org/?p=1260</guid>
		<description><![CDATA[I installed a bare bones Arch Linux system today and took a screenshot.  With no graphics utilities installed, I needed a way to convert a PNG to a GIF for a Simple Machines forum template thumbnail.  I figured I&#8217;d use a command line utility to help me and ImageMagick is installed by default on most [...]
No related posts.

Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>I installed a bare bones Arch Linux system today and took a screenshot.  With no graphics utilities installed, I needed a way to convert a PNG to a GIF for a Simple Machines forum template thumbnail.  I figured I&#8217;d use a command line utility to help me and ImageMagick is installed by default on most distributions.  A quick read through the ImageMagick manpage and I found the <em>convert</em> command and thought I&#8217;d share it with everyone.  Use convert in the following fashion:  <strong>convert [input-options] input-file [output-options] output-file</strong></p>
<pre class="brush: plain; title: ; notranslate">convert SMFPress.png -channel Alpha -threshold 80% -resize 120x120 thumbnail.gif</pre>
<p>This did a quick, same-size conversion with little loss for me to display the thumbnail online.  For more information on the options I used and other options that I didn&#8217;t use, take a peek at the<a title="ImageMagick Help Convert" href="http://www.imagemagick.org/script/convert.php" target="_blank"> ImageMagick Online Help Page for convert.</a></p>
<p>No related posts.</p>
<p>Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.</p><p><a href="http://linux-blog.org/convert-png-to-gif-via-command-line/" rel="bookmark">Convert PNG to GIF via Command Line</a> originally appeared on <a href="http://linux-blog.org">Yet Another Linux Blog</a> on November 6, 2009.</p>
]]></content:encoded>
			<wfw:commentRss>http://linux-blog.org/convert-png-to-gif-via-command-line/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>Adding Color to Bash List Command Part II</title>
		<link>http://linux-blog.org/adding-color-to-bash-list-command-part-ii/</link>
		<comments>http://linux-blog.org/adding-color-to-bash-list-command-part-ii/#comments</comments>
		<pubDate>Tue, 08 Sep 2009 18:25:16 +0000</pubDate>
		<dc:creator>devnet</dc:creator>
				<category><![CDATA[Featured]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[cli]]></category>
		<category><![CDATA[color]]></category>
		<category><![CDATA[prompt]]></category>
		<category><![CDATA[tips and tricks]]></category>

		<guid isPermaLink="false">http://linux-blog.org/?p=1209</guid>
		<description><![CDATA[I previously blogged about how to add color to the &#8216;ls&#8217; command utilizing an config file and alias.  I then stumbled across a nugget of wisdom from a Foresight Linux user on the developers mailing list who gave a handy command that remedies some problems with missing color in a terminal. On some distributions, the [...]
No related posts.

Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>I <a href="http://linux-blog.org/adding-color-to-bash-list-command/" target="_blank">previously blogged about how to add color to the &#8216;ls&#8217; command</a> utilizing an config file and alias.  I then stumbled across a nugget of wisdom from a Foresight Linux user on the developers mailing list who gave a handy command that remedies some problems with missing color in a terminal.</p>
<p>On some distributions, the system-wide <em>/etc/DIR_COLORS</em>* files are removed or not present.  This results in no colors being given inside of a terminal when looking for color directories and filenames.  If you find yourself in this boat, try the following command to re-populate this setting:</p>
<pre class="brush: bash; title: ; notranslate">devnet-&gt; cd ~/
devnet-&gt; dircolors -p &gt;.dircolors
</pre>
<p>This should create a default profile for colors for your session if it hasn&#8217;t been done or was accidentally removed.  For more information on the dircolors command try &#8216;man dircolors&#8217;.  Please also note that <em>dircolors</em> command uses the environmental variable LS_COLORS to set your session.</p>
<p>For more information on LS_COLORS and how it pertains to the terminal/shell/cli/prompt, there are a few blog posts that do an excellent job explaining <a href="http://twistedcode.blogspot.com/2008/04/lscolors-explained.html" target="_blank">here</a>, <a href="http://linux-sxs.org/housekeeping/lscolors.html" target="_blank">here</a> and <a href="http://www.bigsoft.co.uk/blog/index.php/2008/04/11/configuring-ls_colors" target="_blank">here</a>.</p>
<p>No related posts.</p>
<p>Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.</p><p><a href="http://linux-blog.org/adding-color-to-bash-list-command-part-ii/" rel="bookmark">Adding Color to Bash List Command Part II</a> originally appeared on <a href="http://linux-blog.org">Yet Another Linux Blog</a> on September 8, 2009.</p>
]]></content:encoded>
			<wfw:commentRss>http://linux-blog.org/adding-color-to-bash-list-command-part-ii/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Adding Color to Bash List Command</title>
		<link>http://linux-blog.org/adding-color-to-bash-list-command/</link>
		<comments>http://linux-blog.org/adding-color-to-bash-list-command/#comments</comments>
		<pubDate>Fri, 05 Jun 2009 21:00:06 +0000</pubDate>
		<dc:creator>devnet</dc:creator>
				<category><![CDATA[Featured]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[cli]]></category>
		<category><![CDATA[color]]></category>
		<category><![CDATA[prompt]]></category>
		<category><![CDATA[tips and tricks]]></category>

		<guid isPermaLink="false">http://linux-blog.org/?p=1067</guid>
		<description><![CDATA[One of the things I love is being able to enter into a directory via terminal, list the contents, and quickly see which ones are executable or not and which ones are directories or are not directories IN COLOR (not everyone is perfect right?).  This is specifically handy as I move through working with Slackware [...]
No related posts.

Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>One of the things I love is being able to enter into a directory via terminal, list the contents, and quickly see which ones are executable or not and which ones are directories or are not directories IN COLOR (not everyone is perfect right?).  This is specifically handy as I move through working with <a href="http://slackware.com">Slackware</a> based distributions like the one I&#8217;m using now, <a href="http://zenwalk.org">Zenwalk</a> Linux 6 and the <em>/etc/rc.d/</em> directory.  Most of the Red Hat based distributions out there that I&#8217;ve used have this set automatically&#8230;so I&#8217;m used to it.  When I opened up a terminal in Zenwalk I found no color. A quick investigation of <em>~/.bashrc</em> showed me that there are aliases set to display color&#8230;instead of ls I&#8217;d just use the letter L; 2 l&#8217;s for another option, 3 for another.  It&#8217;s interesting, but not normally how I do business.  See bashrc below:</p>
<pre class="brush: bash; highlight: [2,3,4]; title: ; notranslate">
devnet[~]$ cat ~/.bashrc
alias lll=&quot;ls -al --color&quot;
alias ll=&quot;ls -l --color&quot;
alias l='ls --color'&lt;br /&gt;alias search='find . -name'
alias aterm=&quot;aterm -fg white -tr&quot;
alias version='cat /etc/zenwalk-version'
alias dh='df -h'&lt;br /&gt;export PS1='\u[\W]\$ '
export PAGER=&quot;most&quot;&lt;br /&gt;devnet[~]$
</pre>
<p>I don&#8217;t use those aliases much&#8230;others of you might do the &#8216;ll&#8217; or &#8216;lll&#8217; but it&#8217;s just not part of my routine.  So, I added in just after line 4 in the code above:</p>
<pre class="brush: bash; title: ; notranslate">
alias ls='ls --color'
</pre>
<p>You can do this a few different ways&#8230;with any command line editor like emacs, vi, or nano/pico.  It&#8217;s really up to you.  The easiest way for new users is to use a text editor:</p>
<pre class="brush: bash; title: ; notranslate">
devnet[~]$ mousepad ~/.bashrc
</pre>
<p>This will launch the mousepad text editor in XFCE.  If you&#8217;re in Gnome, try gedit.  If KDE, give kwrite a try.  You should see something like the following window pop up for editing:</p>
<p style="text-align: left;"><a href="http://linux-blog.org/wp-content/uploads/2009/06/bashrc.png"><img class="aligncenter size-full wp-image-1084" style="rel=&quot;lightbox&quot;" title="bashrc" src="http://linux-blog.org/wp-content/uploads/2009/06/bashrc.png" alt="bashrc" width="188" height="131" /></a>You should see in the picture above, I&#8217;ve added in the alias needed to make me comfortable.  After that, File &gt;&gt; Save.  You&#8217;re set!  Except, you may notice that when you type the command &#8216;ls&#8217; there are no colors.  So what gives?  Well, we haven&#8217;t loaded our <em>./bashrc</em> since we changed it.  You don&#8217;t have to logout and back in to get things to work though&#8230;you can do this right from the terminal:</p>
<pre class="brush: bash; title: ; notranslate">
devnet[~]$ exec bash
</pre>
<p>Now try giving the &#8216;ls&#8217; command a try again and you should see that it is in color.  I know a lot of the more advanced Linux guys out there are probably saying, &#8220;why&#8217;d he waste a post on this!  It&#8217;s easy&#8221; and you&#8217;d be right for a majority of users out there&#8230;I hope that this post finds some new user out there that may be stuck for an answer on how to do this.  One final note on this as well: You will have to do this as the root user and change <em>/root/.bashrc</em> in order for your root user to also have color.  Thanks for reading!<br />
<script type="text/javascript">// < ![CDATA[
google_ad_client = "pub-3982453702542240";
/* 468x15, created 6/24/09 */
google_ad_slot = "6181047080";
google_ad_width = 468;
google_ad_height = 15;
// ]]&gt;</script><br />
<script src="http://pagead2.googlesyndication.com/pagead/show_ads.js" type="text/javascript">
</script></p>
<p>No related posts.</p>
<p>Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.</p><p><a href="http://linux-blog.org/adding-color-to-bash-list-command/" rel="bookmark">Adding Color to Bash List Command</a> originally appeared on <a href="http://linux-blog.org">Yet Another Linux Blog</a> on June 5, 2009.</p>
]]></content:encoded>
			<wfw:commentRss>http://linux-blog.org/adding-color-to-bash-list-command/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Read &amp; Display Single Line of a File</title>
		<link>http://linux-blog.org/read-display-single-line-of-a-file/</link>
		<comments>http://linux-blog.org/read-display-single-line-of-a-file/#comments</comments>
		<pubDate>Tue, 18 Nov 2008 21:38:49 +0000</pubDate>
		<dc:creator>devnet</dc:creator>
				<category><![CDATA[Featured]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[Asides]]></category>
		<category><![CDATA[cli]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[shell]]></category>

		<guid isPermaLink="false">http://linux-blog.org/?p=780</guid>
		<description><![CDATA[Sometimes when I&#8217;m troubleshooting a PHP error and a function is called in the debugger that gives me a line number of a file to look at, I want to know what that line says without opening up the file.  Using the command line, you can accomplish this in the following way: head -n 96 [...]
No related posts.

Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>Sometimes when I&#8217;m troubleshooting a PHP error and a function is called in the debugger that gives me a line number of a file to look at, I want to know what that line says without opening up the file.  Using the command line, you can accomplish this in the following way:</p>
<pre>head -n 96 filename.php | tail -n 1</pre>
<p>This allows you to quickly display the 96th line of filename.php.  Hope this helps someone like it has me.</p>
<p>No related posts.</p>
<p>Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.</p><p><a href="http://linux-blog.org/read-display-single-line-of-a-file/" rel="bookmark">Read &#038; Display Single Line of a File</a> originally appeared on <a href="http://linux-blog.org">Yet Another Linux Blog</a> on November 18, 2008.</p>
]]></content:encoded>
			<wfw:commentRss>http://linux-blog.org/read-display-single-line-of-a-file/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Print Readable Man Pages</title>
		<link>http://linux-blog.org/print-readable-man-pages/</link>
		<comments>http://linux-blog.org/print-readable-man-pages/#comments</comments>
		<pubDate>Wed, 14 Nov 2007 14:49:40 +0000</pubDate>
		<dc:creator>devnet</dc:creator>
				<category><![CDATA[Featured]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[cli]]></category>
		<category><![CDATA[console]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[tips and tricks]]></category>

		<guid isPermaLink="false">http://linux-blog.org/word/print-readable-man-pages/</guid>
		<description><![CDATA[Ever wonder how you can get a man page in into a format you can read and print? There&#8217;s many methods of doing it (copy and paste is one) but one the easiest I&#8217;ve found is: man command &#124; col -x -b &#62; command.txt Where command is the Linux command man page you want to [...]
No related posts.

Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>Ever wonder how you can get a man page in into a format you can read and print?  There&#8217;s many methods of doing it (copy and paste is one) but one the easiest I&#8217;ve found is:</p>
<pre>man command | col -x -b  &gt; command.txt</pre>
<p>Where command is the Linux command man page you want to print/view.  From there, open up command.txt in your favorite gui text editor (gedit, kate) and you have a readable format that could be printed quite easily for reference.</p>
<p>No related posts.</p>
<p>Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.</p><p><a href="http://linux-blog.org/print-readable-man-pages/" rel="bookmark">Print Readable Man Pages</a> originally appeared on <a href="http://linux-blog.org">Yet Another Linux Blog</a> on November 14, 2007.</p>
]]></content:encoded>
			<wfw:commentRss>http://linux-blog.org/print-readable-man-pages/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

