<?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>Mon, 30 Aug 2010 14:18:09 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<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 [...]


Related posts:<ol><li><a href='http://linux-blog.org/adding-color-to-bash-list-command-part-ii/' rel='bookmark' title='Permanent Link: Adding Color to Bash List Command Part II'>Adding Color to Bash List Command Part II</a> <small>I previously blogged about how to add color to the...</small></li>
</ol>

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>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;">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>Related posts:<ol><li><a href='http://linux-blog.org/adding-color-to-bash-list-command-part-ii/' rel='bookmark' title='Permanent Link: Adding Color to Bash List Command Part II'>Adding Color to Bash List Command Part II</a> <small>I previously blogged about how to add color to the...</small></li>
</ol></p>
<p>Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.</p><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>9</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[Tips]]></category>
		<category><![CDATA[linux]]></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://mitcho.com/code/yarpp/'>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;">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://mitcho.com/code/yarpp/'>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[Tips]]></category>
		<category><![CDATA[linux]]></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 [...]


Related posts:<ol><li><a href='http://linux-blog.org/adding-color-to-bash-list-command-part-ii/' rel='bookmark' title='Permanent Link: Adding Color to Bash List Command Part II'>Adding Color to Bash List Command Part II</a> <small>I previously blogged about how to add color to the...</small></li>
<li><a href='http://linux-blog.org/convert-png-to-gif-via-command-line/' rel='bookmark' title='Permanent Link: Convert PNG to GIF via Command Line'>Convert PNG to GIF via Command Line</a> <small>I installed a bare bones Arch Linux system today and...</small></li>
<li><a href='http://linux-blog.org/installing-openbox-on-foresight-linux/' rel='bookmark' title='Permanent Link: Installing Openbox on Foresight Linux'>Installing Openbox on Foresight Linux</a> <small>My friend Og Maciel originally introduced me to Openbox a...</small></li>
</ol>

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>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];">
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;">
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;">
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;">
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>Related posts:<ol><li><a href='http://linux-blog.org/adding-color-to-bash-list-command-part-ii/' rel='bookmark' title='Permanent Link: Adding Color to Bash List Command Part II'>Adding Color to Bash List Command Part II</a> <small>I previously blogged about how to add color to the...</small></li>
<li><a href='http://linux-blog.org/convert-png-to-gif-via-command-line/' rel='bookmark' title='Permanent Link: Convert PNG to GIF via Command Line'>Convert PNG to GIF via Command Line</a> <small>I installed a bare bones Arch Linux system today and...</small></li>
<li><a href='http://linux-blog.org/installing-openbox-on-foresight-linux/' rel='bookmark' title='Permanent Link: Installing Openbox on Foresight Linux'>Installing Openbox on Foresight Linux</a> <small>My friend Og Maciel originally introduced me to Openbox a...</small></li>
</ol></p>
<p>Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.</p><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 [...]


Related posts:<ol><li><a href='http://linux-blog.org/convert-png-to-gif-via-command-line/' rel='bookmark' title='Permanent Link: Convert PNG to GIF via Command Line'>Convert PNG to GIF via Command Line</a> <small>I installed a bare bones Arch Linux system today and...</small></li>
</ol>

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>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>Related posts:<ol><li><a href='http://linux-blog.org/convert-png-to-gif-via-command-line/' rel='bookmark' title='Permanent Link: Convert PNG to GIF via Command Line'>Convert PNG to GIF via Command Line</a> <small>I installed a bare bones Arch Linux system today and...</small></li>
</ol></p>
<p>Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.</p><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 [...]


Related posts:<ol><li><a href='http://linux-blog.org/convert-png-to-gif-via-command-line/' rel='bookmark' title='Permanent Link: Convert PNG to GIF via Command Line'>Convert PNG to GIF via Command Line</a> <small>I installed a bare bones Arch Linux system today and...</small></li>
<li><a href='http://linux-blog.org/adding-color-to-bash-list-command-part-ii/' rel='bookmark' title='Permanent Link: Adding Color to Bash List Command Part II'>Adding Color to Bash List Command Part II</a> <small>I previously blogged about how to add color to the...</small></li>
</ol>

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>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>Related posts:<ol><li><a href='http://linux-blog.org/convert-png-to-gif-via-command-line/' rel='bookmark' title='Permanent Link: Convert PNG to GIF via Command Line'>Convert PNG to GIF via Command Line</a> <small>I installed a bare bones Arch Linux system today and...</small></li>
<li><a href='http://linux-blog.org/adding-color-to-bash-list-command-part-ii/' rel='bookmark' title='Permanent Link: Adding Color to Bash List Command Part II'>Adding Color to Bash List Command Part II</a> <small>I previously blogged about how to add color to the...</small></li>
</ol></p>
<p>Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.</p><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>
		<item>
		<title>Dealing with Runaway Processes</title>
		<link>http://linux-blog.org/dealing-with-runaway-processes/</link>
		<comments>http://linux-blog.org/dealing-with-runaway-processes/#comments</comments>
		<pubDate>Mon, 12 Mar 2007 20:24:48 +0000</pubDate>
		<dc:creator>devnet</dc:creator>
				<category><![CDATA[Tips]]></category>
		<category><![CDATA[cli]]></category>
		<category><![CDATA[console]]></category>
		<category><![CDATA[desktop]]></category>
		<category><![CDATA[kde]]></category>
		<category><![CDATA[Kwhat?]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[tips and tricks]]></category>

		<guid isPermaLink="false">http://linux-blog.org/word/dealing-with-runaway-processes/</guid>
		<description><![CDATA[Have you ever been using your Linux distro and suddenly found a program won&#8217;t close? It&#8217;s frustrating when an application hangs. In Windows, one could right click on the taskbar and choose &#8220;Task Manager&#8221; and kill the hanging process (which doesn&#8217;t always work BTW). In Linux, you can also kill these hanging processes. First, if [...]


Related posts:<ol><li><a href='http://linux-blog.org/convert-png-to-gif-via-command-line/' rel='bookmark' title='Permanent Link: Convert PNG to GIF via Command Line'>Convert PNG to GIF via Command Line</a> <small>I installed a bare bones Arch Linux system today and...</small></li>
<li><a href='http://linux-blog.org/adding-color-to-bash-list-command-part-ii/' rel='bookmark' title='Permanent Link: Adding Color to Bash List Command Part II'>Adding Color to Bash List Command Part II</a> <small>I previously blogged about how to add color to the...</small></li>
</ol>

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>Have you ever been using your Linux distro and suddenly found a program won&#8217;t close?  It&#8217;s frustrating when an application hangs.  In Windows, one could right click on the taskbar and choose &#8220;Task Manager&#8221; and kill the hanging process (which doesn&#8217;t always work BTW).  In Linux, you can also kill these hanging processes.</p>
<p><!-- s9ymdb:525 --><a class="serendipity_image_link" href="/uploads/Posts/runaway.png"><!-- s9ymdb:525 --><img style="border: 0px none ; float: left; padding-left: 5px; padding-right: 5px;" src="/uploads/Posts/runaway.Thumbs.png" alt="" width="110" height="67" /></a>First, if you&#8217;re using KDE press Control-Escape.  This will give all processes in a handy window called the KDE System Guard. Clicking the column heading for &#8220;System %&#8221; so the arrow on it appears facing up will sort the processes from highest system percentage to lowest.  Find the process that seems to be hogging up all the resources (or if you know the name of the process, highlight that) and then hit the kill button.  Your process should end it&#8217;s routines and exit.</p>
<p>You can also check out which program is hogging up your virtual memory with its process which can also slow things up.  Clicking on the column &#8220;VmSize&#8221; and sorting largest to smallest will allow you to see this and select which<!-- s9ymdb:526 --><!-- s9ymdb:526 --><img style="border: 0px none ; float: right; padding-left: 5px; padding-right: 5px;" src="/uploads/Posts/runaway1.Thumbs.png" alt="" width="110" height="57" /> process to kill.  I often elect to select only user processes using the drop down menu at the top right hand corner of the KDE System Guard.  Doing this filters out all system files and shows any hanging applications that are initiated by the user (which is often what is hanging for me).</p>
<p>Don&#8217;t worry if you see the same process more than once (for example, Apache or php may have multiple entries if you run a webserver&#8230;this is normal).  If you&#8217;re using Gnome, you&#8217;ll either have to use the console method I explain below or launch the Gnome System Manager to get things rolling.  Since I don&#8217;t use Gnome, I won&#8217;t cover the Gnome System Manager here.</p>
<p>Another way you can do things&#8230;especially if all Xwindows (KDE, Gnome, Fluxbox, etc) have frozen or are sluggish is to drop to a console.  You can do this by killing the Xserver or by dropping to a console.  You can press Alt-F2 or Alt-F3 and get directly to a console.  Login as root.  Now let&#8217;s take a look and see what processes are hogging up resources.  Kill the Xserver and drop to a console by hitting Control-Alt-Backspace.  For our purposes, I&#8217;ll assume you&#8217;ve made it to the console now.</p>
<p><a class="serendipity_image_link" href="/uploads/Posts/topcommand.png"><!-- s9ymdb:527 --><img style="border: 0px none ; float: left; padding-left: 5px; padding-right: 5px;" src="/uploads/Posts/topcommand.Thumbs.png" alt="" width="110" height="82" /></a>There&#8217;s a quick console way of finding exactly what is consuming the most of your PC as far as processes are concerned. Using the the &#8216;top&#8217; command will display those processes that are beasts and allow you to take note of them.  Look for the process taking up the most CPU% (which should appear at the &#8216;top&#8217; of your &#8216;top&#8217; output).  Pay specific attention to the PID column of that high CPU% item and make a note of it.  This is the process ID number and every program running on a Linux box is assigned one by the Kernel.  We&#8217;ve found the one making problems for us and have recorded the PID so let&#8217;s slay it.  Hit Control-C to stop the top command and then type:</p>
<pre class="brush: plain;">kill PID</pre>
<p>Where PID is the process ID number you made a note of before.  You may not get confirmation that the task has been immediately killed so let&#8217;s see if it is still running.  We may not get the information we need by using top again since it is mainly for finding the higher consuming processes aka runaways.  Instead, let&#8217;s use the ps command.</p>
<pre class="brush: plain;">ps aux | more</pre>
<p>This command outputs all processes in a nice way&#8230;using the | and &#8216;more&#8217; command allows you to paginate the output so that if there are a TON of processes, you can use the spacebar or arrow keys to page down (you can do<a class="serendipity_image_link" href="http://linux-blog.org/uploads/Posts/psauxgrep.png"><!-- s9ymdb:528 --></a> that with any command too BTW).  Now look for that PID that we just killed in the second column and see if it is there.  You could also get creative and use:</p>
<pre class="brush: plain;"> ps aux | grep PID</pre>
<p><a class="serendipity_image_link" href="http://linux-blog.org/uploads/Posts/psauxgrep.png"><img style="border: 0px none ; float: right; padding-left: 5px; padding-right: 5px;" src="http://linux-blog.org/uploads/Posts/psauxgrep.Thumbs.png" alt="" width="110" height="89" /></a></p>
<p>Where PID is once again the PID you killed. The grep command will search through the results and echo back to you any matching entries it finds.  If you didn&#8217;t find anything and couldn&#8217;t match your PID to that of any displayed in your ps aux command, you just successfully killed that beastly process.  As always, for more information, please see the man pages (e.g. man ps or man top).</p>
<p>Hopefully, this allows you to more efficiently manage your processes&#8230;runaway or normal.  If I&#8217;ve printed an error, please let me know via the comments below or if there is a more efficient way of doing things let me know there as well&#8230;I&#8217;m always open to improvement.</p>
<p>UPDATE:  Please checkout the comments section for a few more tips on killing processes!</p>
<p>UPDATE2:  Reader <a href="http://www.systemnotes.org/" target="_blank">Scott M</a> writes in the comments below &#8220;You don&#8217;t have to use the PID.  You can use the -f option.  e.g. if there are multiple instance of SomeProgram, you can kill them all with one command:</p>
<p>pkill -9 -f SomeProgram&#8221;  Thanks Scott!</p>


<p>Related posts:<ol><li><a href='http://linux-blog.org/convert-png-to-gif-via-command-line/' rel='bookmark' title='Permanent Link: Convert PNG to GIF via Command Line'>Convert PNG to GIF via Command Line</a> <small>I installed a bare bones Arch Linux system today and...</small></li>
<li><a href='http://linux-blog.org/adding-color-to-bash-list-command-part-ii/' rel='bookmark' title='Permanent Link: Adding Color to Bash List Command Part II'>Adding Color to Bash List Command Part II</a> <small>I previously blogged about how to add color to the...</small></li>
</ol></p>
<p>Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.</p><p><a href="http://linux-blog.org/dealing-with-runaway-processes/" rel="bookmark">Dealing with Runaway Processes</a> originally appeared on <a href="http://linux-blog.org">Yet Another Linux Blog</a> on March 12, 2007.</p>
]]></content:encoded>
			<wfw:commentRss>http://linux-blog.org/dealing-with-runaway-processes/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
	</channel>
</rss>
