<?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>gHacks Technology News &#124; Latest Tech News, Software And Tutorials &#187; ps</title> <atom:link href="http://www.ghacks.net/tag/ps/feed/" rel="self" type="application/rss+xml" /><link>http://www.ghacks.net</link> <description>A technology news blog covering software, mobile phones, gadgets, security, the Internet and other relevant areas.</description> <lastBuildDate>Sat, 11 Feb 2012 09:52:46 +0000</lastBuildDate> <language>en</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.3.1</generator> <atom:link rel="hub" href="http://pubsubhubbub.appspot.com"/><atom:link rel="hub" href="http://superfeedr.com/hubbub"/> <item><title>How a virtual console can keep you from losing work</title><link>http://www.ghacks.net/2009/07/18/how-a-virtual-console-can-keep-you-from-losing-work/</link> <comments>http://www.ghacks.net/2009/07/18/how-a-virtual-console-can-keep-you-from-losing-work/#comments</comments> <pubDate>Sat, 18 Jul 2009 20:41:08 +0000</pubDate> <dc:creator>Jack Wallen</dc:creator> <category><![CDATA[Advice]]></category> <category><![CDATA[Desktop Manager]]></category> <category><![CDATA[Linux]]></category> <category><![CDATA[Open Source]]></category> <category><![CDATA[troubleshooting]]></category> <category><![CDATA[Tutorials Basic]]></category> <category><![CDATA[kill command]]></category> <category><![CDATA[open-office]]></category> <category><![CDATA[ps]]></category> <category><![CDATA[virtual consoles]]></category> <guid
isPermaLink="false">http://www.ghacks.net/?p=14516</guid> <description><![CDATA[Just about fifteen minutes ago I was working on an article for Linux.com when I thought I was going to lose a ton of work. I was writing my last paragraph on a 1,600+ word article (entering the article in their web-based system). I was going back to OpenOffice to copy and paste all of [...]]]></description> <content:encoded><![CDATA[<p>Just about fifteen minutes ago I was working on an article for Linux.com when I thought I was going to lose a ton of work. I was writing my last paragraph on a 1,600+ word article (entering the article in their web-based system). I was going back to OpenOffice to copy and paste all of my work before submitting the article when OpenOffice locked up my desktop. After an explicative escaped my mouth I calmly set about to try to recover my work. I succeeded, but only with the help of a virtual console.</p><p>Now normally I do frequent saving to avoid such issues. But right now there is no Save Draft function so I rely on frequent saving to OpenOffice. It always works and I rarely have issues. This time, however, I did. When I un-iconified OpenOffice (I am using Elive-Compiz so applications minimize to icons) everything but he cursor and keyboard froze up tight. Or so I thought.What actually happened was that OpenOffice caused an issue keeping me from gaining access to any application. I could move the cursor but that was it. I couldn&#8217;t get a menu or interact with any applications.</p><p><span
id="more-14516"></span><strong>What happened?</strong></p><p>For those that are curious here is the output of my <strong>~/.xsession-errors</strong> file:<br
/> <code>window managed: 0xc0155b : 0x40abdc, 402<br
/> window managed: 0xc01576 : 0x40afed, 402<br
/> Unhandled property: 41 font<br
/> Unhandled property: 41 font<br
/> _e_container_cb_mouse_down<br
/> _e_container_cb_mouse_down<br
/> _e_container_cb_mouse_down<br
/> window managed: 0xc015dc : 0x14035fe, 402<br
/> act fn max<br
/> max parse: NONE<br
/> window managed: 0xc01637 : 0x1c0b86d, 402<br
/> _e_container_cb_mouse_down<br
/> efreet_desktop_new error: no Desktop Entry section<br
/> _e_container_cb_mouse_down<br
/> window managed: 0xc016f0 : 0x240000a, 402</code></p><p>After a bit of research it looks like it could be an autoraise error. That, of course, doesn&#8217;t mention how I got out of this situation. Let&#8217;s take a look.</p><p><strong>How it worked out</strong></p><p>Fortunately I had a good idea which application caused the problem. I assumed this because OpenOffice Writer was the last application I had any interaction with. Even if it wasn&#8217;t OpenOffice I had the following applications open that could have possibly caused the problem.</p><ul><li>Claws Mail</li><li>Firefox</li><li>Rhythmbox</li><li>GnuCash</li><li>xterm</li></ul><p>I had to hope that the issue wasn&#8217;t Firefox, because that was the data I really needed to save. So, with my list in hand I hopped over to a virtual console to see if I could get lucky.</p><p><strong>Getting to a virtual console</strong></p><p>Virtual consoles allow you to, effectively, have more than one user logged in. Or you could have the same user logged in with one instance being a graphical desktop and the other a command line desktop. To get to different virtual desktops you enter the Ctrl-Alt-F*keys (Where * is 1-0). When I got to the virtual console I logged in with the my standard user information and was greeted with my bash prompt. Since I assumed the culprit was OpenOffice writer I wanted to get the PID of this application so I issued the command:</p><p><em>ps aux | grep soffice</em></p><p>Which gave the proper PID for the currently running command <em>soffice -writer</em>. The next step was to issue the <em>kill</em> command on the PID like so:</p><p><em>kill PID</em></p><p>Where PID is the actual PID given to me by the <em>ps </em>command above.</p><p>When the process was killed I then hopped back to my original console (in my case it was Ctrl-Alt-F7) and, lo and behold, I had regained control of my desktop. I could then re-open OpenOffice, save my work, finish my article, and submit.</p><p>Bullet Doged.</p><p><strong>Final thoughts</strong></p><p>Yes this whole situation could have been avoided with a working Save Draft feature, but that is not available yet. I could have also been using a different desktop. The &#8220;what ifs&#8221; could go on and on. But ultimately these things happen and it&#8217;s always nice to know you have the means to solve the problem, even if you have to get creative to do so.</p> ]]></content:encoded> <wfw:commentRss>http://www.ghacks.net/2009/07/18/how-a-virtual-console-can-keep-you-from-losing-work/feed/</wfw:commentRss> <slash:comments>7</slash:comments> </item> <item><title>Get to know Linux: ps command</title><link>http://www.ghacks.net/2009/07/01/get-to-know-linux-ps-command/</link> <comments>http://www.ghacks.net/2009/07/01/get-to-know-linux-ps-command/#comments</comments> <pubDate>Wed, 01 Jul 2009 00:04:35 +0000</pubDate> <dc:creator>Jack Wallen</dc:creator> <category><![CDATA[Advice]]></category> <category><![CDATA[Linux]]></category> <category><![CDATA[Open Source]]></category> <category><![CDATA[Software]]></category> <category><![CDATA[Tutorials Basic]]></category> <category><![CDATA[process status]]></category> <category><![CDATA[processes]]></category> <category><![CDATA[ps]]></category> <guid
isPermaLink="false">http://www.ghacks.net/?p=14023</guid> <description><![CDATA[Over the years there have been certain commands that have really helped me out of a bind. One of those commands is the ps command. The ps stands for process status and it tells you, as you would expect, the status of a process. This is a fast way to know if an application or [...]]]></description> <content:encoded><![CDATA[<p>Over the years there have been certain commands that have really helped me out of a bind. One of those commands is the <em>ps</em> command. The <em>ps </em>stands for <em>process status</em> and it tells you, as you would expect, the status of a process. This is a fast way to know if an application or command is running on a Linux system. Oh sure you could fire up a swell GUI for the same purpose, but that GUI does you no good if you are working on a headless server installation or working on a remote machine. In those instances the <em>ps </em>command is your best bet for helping to manage processes.</p><p>You will be glad to know that the <em>ps</em> command will most certainly be already installed on your Linux machine, so there is no need to worry about installation.</p><p><span
id="more-14023"></span><strong>Command structure</strong></p><p>The basic command structure for <em>ps </em>is:</p><p>ps OPTION</p><p>Of course every good Linux command offers a lot of options, and <em>ps</em> is no exception. For this command we will just outline the best groupings of options together instead of just listing all of (or the best) options. This way you can skip right down to the command you need to use.</p><p><strong>Show list of processes owned by a specific user</strong></p><p>Say I want to list all processes owned by user <em>jlwallen</em>. To do this I could enter one of two commands:</p><p><em>ps ux</em></p><p>This will list out all processes that are owned by the user issuing the command. The results for this command will look like:</p><p><code>USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND<br
/> jlwallen   560  0.0  0.3  18312  7376 ?        SNs  19:40   0:00 /etc/alternativ<br
/> jlwallen   561  0.0  0.1   7316  3932 pts/0    SNs  19:40   0:00 bash<br
/> jlwallen  1137  0.0  0.0   1644   416 ?        S    19:47   0:00 sleep 8<br
/> jlwallen  1141  0.0  0.0   1644   420 ?        S    19:47   0:00 sleep 8<br
/> jlwallen  1142  0.0  0.0   4384  1012 pts/0    RN+  19:48   0:00 ps ux</code></p><p>You can also get a similar listing with the command:</p><p><em>ps U jlwallen</em></p><p>The results of this command will be:</p><p><code>PID TTY      STAT   TIME COMMAND<br
/> 560 ?        SNs    0:00 /etc/alternatives/x-terminal-emulator<br
/> 561 pts/0    SNs    0:00 bash<br
/> 1223 ?        S      0:00 sleep 8<br
/> 1227 ?        S      0:00 sleep 8<br
/> 1228 pts/0    RN+    0:00 ps U jlwallen</code></p><p><strong>Show all processes</strong></p><p>To see every process on your system you would enter the command:</p><p><em>ps aux</em></p><p>The results of this command would look similar to that of <em>ps ux</em> only it would show the process of every user as well as the system.</p><p><strong>List the details of a single process</strong></p><p>What about when you want to see the details of only a single process? Imagine issuing the command <em>ps ux</em> and having to search through all of the listings to find the information about the one process you are trying to gain information about. Say, for example, you need to find the PID (Process ID) of the currently running daemon for Dansguardian. You can use the <em>ps</em> command and pipe the results to the <em>grep</em> command to search the listing for a specific string and print out only the matching strings. To do this issue the command:</p><p><em>ps aux | grep dansguardian</em></p><p>which will print out something like:</p><p><code>113       2596  0.0  0.5  17852 11460 ?        Ss   06:49   0:00 /usr/sbin/dansguardian</code></p><p>Now you can see the PID of Dansguardian is 2596. You can kill this with the <em>kill 2956 </em>command.</p><p><strong>Final thoughts</strong></p><p>There are many more uses for the <em>ps</em> command as well as many more ways to use the <em>ps </em>command. The above three examples are the most often used, but don&#8217;t think you are limited to only those uses. Issue the command <em>man ps</em> and you will see a full listing of all the <em>ps</em> options available to you.</p> ]]></content:encoded> <wfw:commentRss>http://www.ghacks.net/2009/07/01/get-to-know-linux-ps-command/feed/</wfw:commentRss> <slash:comments>2</slash:comments> </item> <item><title>Linux Process Management: Command Line</title><link>http://www.ghacks.net/2009/02/25/linux-process-management-command-line/</link> <comments>http://www.ghacks.net/2009/02/25/linux-process-management-command-line/#comments</comments> <pubDate>Wed, 25 Feb 2009 01:25:33 +0000</pubDate> <dc:creator>Jack Wallen</dc:creator> <category><![CDATA[Advice]]></category> <category><![CDATA[Linux]]></category> <category><![CDATA[Open Source]]></category> <category><![CDATA[Tutorials Advanced]]></category> <category><![CDATA[Tutorials Basic]]></category> <category><![CDATA[kill]]></category> <category><![CDATA[killall]]></category> <category><![CDATA[process control]]></category> <category><![CDATA[ps]]></category> <guid
isPermaLink="false">http://www.ghacks.net/?p=10739</guid> <description><![CDATA[Previously I wrote about using GUI tools for Linux process management (Get To Know Linux: Process Management.) Both the GNOME and the KDE tools are outstanding, user-friendly solutions to an issue that can often become troublesome. But what if you are running a headless server? Or what happens if that runaway process is X Windows [...]]]></description> <content:encoded><![CDATA[<p>Previously I wrote about using GUI tools for Linux process management (<a
title="Get To Know Linux: Process Management" href="http://www.ghacks.net/2009/02/23/get-to-know-linux-process-management/" target="_blank">Get To Know Linux: Process Management</a>.) Both the GNOME and the KDE tools are outstanding, user-friendly solutions to an issue that can often become troublesome. But what if you are running a headless server? Or what happens if that runaway process is X Windows itself? What do you do? You open up a terminal window and issue a command. In this article you are going to learn just that, killing rogue processes by command line.</p><p>Although you might think this a system of process management that should be avoided by the new user, you should consider that there may be times when knowing this process can really save your skin. So, although you may tend to shy away from the command line tools, this would be one of those that is good to know in a pinch.</p><p><span
id="more-10739"></span><strong>The Commands</strong></p><p>The first thing you have to understand is the commands you will be using. There are two commands that are useful: <em>kill </em>and <em>killall</em>. The <em>kill</em> command is used in conjunction with a process ID (PID) and the <em>killall</em> command is used in conjunction with command names. Your first reaction is most likely &#8220;How do I get the PID of an application?&#8221; Well, that will take another command.</p><p><strong>Learn By Example</strong></p><p>Let&#8217;s use Firefox as an example. Say, for some reason, Firefox has frozen and you can not get it to respond. Open up a terminal and issue the command <em>killall firefox </em>if that doesn&#8217;t kill Firefox then Firefox was started with a different command. To find out what that command is you could employ the <em>ps</em> command like so:</p><p>ps aux|grep firefox</p><p>The output would look something like:<code><br
/> [jlwallen ~]$ ps aux|grep firefox<br
/> jlwallen 10199  3.8 28.8 417396 223764 ? RNsl Feb23  77:22 /usr/lib/mozilla/firefox-bin -a firefox<br
/> jlwallen 13434  0.0  0.0   3796   688 pts/0  RN+  20:14   0:00 grep firefox</code></p><p>You see the line that includes <em>firefox-bin</em>? That is most like what you need to kill. So issue the command <em>killall firefox-bin</em> and the frozen Firefox will go away.</p><p>If you look up at the command output again you can see the output includes the PID of each command. The PID associated with <em>firefox-bin</em> would be 10199. You could issue the command <em>kill 10199</em> and Firefox would close as well.</p><p><strong>Frozen X</strong></p><p>What if X Windows freezes and you know the culprit was, say, Evolution? You can&#8217;t get to a terminal window so what do you do? You have to go to a different virtual console. To do this you will hit the key combination Ctrl-Alt-F* (Where * is a number 1-9. This number will differ depending upon which virtual console X is running.) Once you are in a virtual consol you will have to log in as your user and then issue the kill command. You can then go back to the virtual console running X and, hopefully, it will be back under your control.</p><p><strong>Final Thoughts</strong></p><p>It&#8217;s not as user-friendly as either the GNOME or KDE tools, but this method is a very valuable method of process control. Some day you will need to have this method in your tool belt and, when you do, you&#8217;ll be glad you have it.</p> ]]></content:encoded> <wfw:commentRss>http://www.ghacks.net/2009/02/25/linux-process-management-command-line/feed/</wfw:commentRss> <slash:comments>6</slash:comments> </item> </channel> </rss>
