<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Kill command in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/kill-command/m-p/3657417#M241505</link>
    <description>1) ps -fu oracle|grep ora_|grep -v grep&lt;BR /&gt;2) ps -fu oracle|grep [o]ra_ &lt;BR /&gt;&lt;BR /&gt;I hope you may not get same for this too at all.&lt;BR /&gt;&lt;BR /&gt;grep is using matching regexp's. &lt;BR /&gt;&lt;BR /&gt;[o]ra_ or ora_ is same. You will get grep ora_ process in process list. If you are selecting all process then,&lt;BR /&gt;&lt;BR /&gt; # ps -efu oracle |grep -v grep | grep &lt;STRING&gt;&lt;BR /&gt;&lt;BR /&gt;If you know full string then,&lt;BR /&gt;&lt;BR /&gt; # UNIX95= ps -fu oracle -C telnetd&lt;BR /&gt;&lt;BR /&gt;If you are going to select few 10 process then, grep will not make any performance issue at all.&lt;BR /&gt;&lt;BR /&gt;-Muthu&lt;/STRING&gt;</description>
    <pubDate>Thu, 27 Oct 2005 05:06:54 GMT</pubDate>
    <dc:creator>Muthukumar_5</dc:creator>
    <dc:date>2005-10-27T05:06:54Z</dc:date>
    <item>
      <title>Kill command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/kill-command/m-p/3657409#M241497</link>
      <description>What is the best way to run a kill command on multiple PID's which will be differnt each day.&lt;BR /&gt;The application spawns connections and before backups we want to remove all of them quickly before stopping the application.   they all look like this: (end with inserverD)&lt;BR /&gt;&lt;BR /&gt; root  8730     1  0 12:29:13 ?         0:25 /inserver54_pro/bin/inserverD&lt;BR /&gt;&lt;BR /&gt;This command below was tried without success, and may not even be close.   I would be grateful for any help.&lt;BR /&gt;&lt;BR /&gt;. kill ps auxww |grep inserverD |egrep -v grep |awk '{print $2}'</description>
      <pubDate>Tue, 25 Oct 2005 17:58:46 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/kill-command/m-p/3657409#M241497</guid>
      <dc:creator>Douglas Henson</dc:creator>
      <dc:date>2005-10-25T17:58:46Z</dc:date>
    </item>
    <item>
      <title>Re: Kill command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/kill-command/m-p/3657410#M241498</link>
      <description>ps -ef | grep inserverD | grep -v grep | awk '{print $2}' | xargs -i kill {}&lt;BR /&gt;&lt;BR /&gt;then run again but with a "stronger" kill in case the first was not helpful&lt;BR /&gt;&lt;BR /&gt;ps -ef | grep inserverD | grep -v grep | awk '{print $2}' | xargs -i kill -9 {}&lt;BR /&gt;</description>
      <pubDate>Tue, 25 Oct 2005 18:10:13 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/kill-command/m-p/3657410#M241498</guid>
      <dc:creator>Marc Ahrendt</dc:creator>
      <dc:date>2005-10-25T18:10:13Z</dc:date>
    </item>
    <item>
      <title>Re: Kill command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/kill-command/m-p/3657411#M241499</link>
      <description>Something like this maybe:&lt;BR /&gt;&lt;BR /&gt;for i in $(ps auxww |grep inserverD |grep -v grep |awk '{print $2}')&lt;BR /&gt;do&lt;BR /&gt;kill ${i}&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;If the application spawns these connections, shouldn't the application be cleaning them up?</description>
      <pubDate>Tue, 25 Oct 2005 18:12:26 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/kill-command/m-p/3657411#M241499</guid>
      <dc:creator>Patrick Wallek</dc:creator>
      <dc:date>2005-10-25T18:12:26Z</dc:date>
    </item>
    <item>
      <title>Re: Kill command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/kill-command/m-p/3657412#M241500</link>
      <description>Hi Douclaus,&lt;BR /&gt;&lt;BR /&gt;  Try this.,&lt;BR /&gt; &lt;BR /&gt; #ps -ef|grep -i inserverD|awk '{print $2)'|xargs kill -9&lt;BR /&gt;&lt;BR /&gt; Cheers.!!Granite&lt;BR /&gt;</description>
      <pubDate>Tue, 25 Oct 2005 18:20:32 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/kill-command/m-p/3657412#M241500</guid>
      <dc:creator>Granite</dc:creator>
      <dc:date>2005-10-25T18:20:32Z</dc:date>
    </item>
    <item>
      <title>Re: Kill command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/kill-command/m-p/3657413#M241501</link>
      <description>Hi,&lt;BR /&gt;try your command with little chanhges:&lt;BR /&gt;&lt;BR /&gt;kill -9 $(ps auxww |grep [i]nserverD awk '{print $2}') &lt;BR /&gt;&lt;BR /&gt;-9 to be sure to kill the process&lt;BR /&gt;$() to execute fisrt the ps command and apply the kill -9 to the result&lt;BR /&gt;grep [i] to avoid grep -v grep&lt;BR /&gt;&lt;BR /&gt;HTH&lt;BR /&gt;Art</description>
      <pubDate>Thu, 27 Oct 2005 02:58:55 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/kill-command/m-p/3657413#M241501</guid>
      <dc:creator>Arturo Galbiati</dc:creator>
      <dc:date>2005-10-27T02:58:55Z</dc:date>
    </item>
    <item>
      <title>Re: Kill command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/kill-command/m-p/3657414#M241502</link>
      <description>grep is not a good idea. why??&lt;BR /&gt;&lt;BR /&gt;ps -ef|grep abc&lt;BR /&gt;Will match following (assuming there are processe like abc, abcd, dhbabc etc)&lt;BR /&gt;&lt;BR /&gt;UNIX95= ps -C"command" -o pid=|xargs kill -15&lt;BR /&gt;&lt;BR /&gt;No kill -9, it is bad sysadmin.</description>
      <pubDate>Thu, 27 Oct 2005 03:13:04 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/kill-command/m-p/3657414#M241502</guid>
      <dc:creator>RAC_1</dc:creator>
      <dc:date>2005-10-27T03:13:04Z</dc:date>
    </item>
    <item>
      <title>Re: Kill command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/kill-command/m-p/3657415#M241503</link>
      <description>We can kill multiple PID's as,&lt;BR /&gt;&lt;BR /&gt;kill &lt;SIGNAL-NUMBER&gt; pid1 pid2 .. pid3&lt;BR /&gt;&lt;BR /&gt;To suite your application,&lt;BR /&gt;&lt;BR /&gt;kill -9 `ps -u root -ef | grep -i inserverd | grep -v grep | awk '{ print $2 }'`&lt;BR /&gt;&lt;BR /&gt;pid=$(ps -u root -ef | grep -i inserverd | grep -v grep | awk '{ print $2 }')&lt;BR /&gt;[[ ! -z ${pid} ]] &amp;amp;&amp;amp; kill -9 ${pid}&lt;BR /&gt;&lt;BR /&gt;-Muthu&lt;/SIGNAL-NUMBER&gt;</description>
      <pubDate>Thu, 27 Oct 2005 03:19:43 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/kill-command/m-p/3657415#M241503</guid>
      <dc:creator>Muthukumar_5</dc:creator>
      <dc:date>2005-10-27T03:19:43Z</dc:date>
    </item>
    <item>
      <title>Re: Kill command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/kill-command/m-p/3657416#M241504</link>
      <description>Hi RAC,&lt;BR /&gt;I never write that grep is a bad idea I just improve teh command reducing its complexity.&lt;BR /&gt;i.e:&lt;BR /&gt;&lt;BR /&gt;1]. giving only | grep ora_ you see in teh output also the grep command itself:&lt;BR /&gt;&lt;BR /&gt;10:29 GPOP09BN hpbbnn1/home/oracle/&amp;gt;  ps -fu oracle|grep ora_ &lt;BR /&gt;  oracle 22714     1  0  Oct 22  ?         1:28 ora_ckpt_BUS01BX&lt;BR /&gt;  oracle 22708     1  0  Oct 22  ?         0:54 ora_pmon_BUS01BX&lt;BR /&gt;  oracle 22720     1  0  Oct 22  ?         0:44 ora_cjq0_BUS01BX&lt;BR /&gt;  oracle 22716     1  0  Oct 22  ?         0:36 ora_smon_BUS01BX&lt;BR /&gt;  oracle 22718     1  0  Oct 22  ?         0:00 ora_reco_BUS01BX&lt;BR /&gt;  oracle 20782     1  0  Oct 22  ?         2:20 ora_ckpt_GPOP09BN&lt;BR /&gt;  oracle 20790     1  0  Oct 22  ?         0:12 ora_arc0_GPOP09BN&lt;BR /&gt;  oracle 20780     1  0  Oct 22  ?         1:38 ora_lgwr_GPOP09BN&lt;BR /&gt;  oracle 20778     1  0  Oct 22  ?         3:52 ora_dbw0_GPOP09BN&lt;BR /&gt;  oracle 20784     1  0  Oct 22  ?         0:39 ora_smon_GPOP09BN&lt;BR /&gt;  oracle 20788     1  0  Oct 22  ?         0:43 ora_cjq0_GPOP09BN&lt;BR /&gt;  oracle 20786     1  0  Oct 22  ?         0:00 ora_reco_GPOP09BN&lt;BR /&gt;  oracle 22712     1  0  Oct 22  ?         6:06 ora_lgwr_BUS01BX&lt;BR /&gt;  oracle 22710     1  0  Oct 22  ?        35:54 ora_dbw0_BUS01BX&lt;BR /&gt;  oracle 20776     1  0  Oct 22  ?         2:25 ora_pmon_GPOP09BN&lt;BR /&gt;  oracle 20792     1  0  Oct 22  ?         0:08 ora_arc1_GPOP09BN&lt;BR /&gt;  oracle 29610 29568  1 10:29:46 pts/ta    0:00 grep ora_&lt;BR /&gt;&lt;BR /&gt;2]. to remove the grep command is needed another grep command: grep -v grep:&lt;BR /&gt;&lt;BR /&gt;10:29 GPOP09BN hpbbnn1/home/oracle/&amp;gt;  ps -fu oracle|grep ora_|grep -v grep&lt;BR /&gt;  oracle 22714     1  0  Oct 22  ?         1:28 ora_ckpt_BUS01BX&lt;BR /&gt;  oracle 22708     1  0  Oct 22  ?         0:54 ora_pmon_BUS01BX                              oracle 22720     1  0  Oct 22  ?         0:44 ora_cjq0_BUS01BX&lt;BR /&gt;  oracle 22716     1  0  Oct 22  ?         0:36 ora_smon_BUS01BX&lt;BR /&gt;  oracle 22718     1  0  Oct 22  ?         0:00 ora_reco_BUS01BX&lt;BR /&gt;  oracle 20782     1  0  Oct 22  ?         2:20 ora_ckpt_GPOP09BN&lt;BR /&gt;  oracle 20790     1  0  Oct 22  ?         0:12 ora_arc0_GPOP09BN&lt;BR /&gt;  oracle 20780     1  0  Oct 22  ?         1:38 ora_lgwr_GPOP09BN&lt;BR /&gt;  oracle 20778     1  0  Oct 22  ?         3:52 ora_dbw0_GPOP09BN&lt;BR /&gt;  oracle 20784     1  0  Oct 22  ?         0:39 ora_smon_GPOP09BN&lt;BR /&gt;  oracle 20788     1  0  Oct 22  ?         0:43 ora_cjq0_GPOP09BN&lt;BR /&gt;  oracle 20786     1  0  Oct 22  ?         0:00 ora_reco_GPOP09BN&lt;BR /&gt;  oracle 22712     1  0  Oct 22  ?         6:06 ora_lgwr_BUS01BX&lt;BR /&gt;  oracle 22710     1  0  Oct 22  ?        35:54 ora_dbw0_BUS01BX&lt;BR /&gt;  oracle 20776     1  0  Oct 22  ?         2:25 ora_pmon_GPOP09BN&lt;BR /&gt;  oracle 20792     1  0  Oct 22  ?         0:08 ora_arc1_GPOP09BN&lt;BR /&gt;&lt;BR /&gt;3]. or more simply you can use grep [o]ra_&lt;BR /&gt;to got your result without including grep in the output list. (man grep (regular expression) for further info):&lt;BR /&gt;&lt;BR /&gt;10:30 GPOP09BN hpbbnn1/home/oracle/&amp;gt;  ps -fu oracle|grep [o]ra_             &lt;BR /&gt;  oracle 22714     1  0  Oct 22  ?         1:28 ora_ckpt_BUS01BX&lt;BR /&gt;  oracle 22708     1  0  Oct 22  ?         0:54 ora_pmon_BUS01BX&lt;BR /&gt;  oracle 22720     1  0  Oct 22  ?         0:44 ora_cjq0_BUS01BX&lt;BR /&gt;  oracle 22716     1  0  Oct 22  ?         0:36 ora_smon_BUS01BX&lt;BR /&gt;  oracle 22718     1  0  Oct 22  ?         0:00 ora_reco_BUS01BX&lt;BR /&gt;  oracle 20782     1  0  Oct 22  ?         2:20 ora_ckpt_GPOP09BN&lt;BR /&gt;  oracle 20790     1  0  Oct 22  ?         0:12 ora_arc0_GPOP09BN&lt;BR /&gt;  oracle 20780     1  0  Oct 22  ?         1:38 ora_lgwr_GPOP09BN&lt;BR /&gt;  oracle 20778     1  0  Oct 22  ?         3:52 ora_dbw0_GPOP09BN&lt;BR /&gt;  oracle 20784     1  0  Oct 22  ?         0:39 ora_smon_GPOP09BN&lt;BR /&gt;  oracle 20788     1  0  Oct 22  ?         0:43 ora_cjq0_GPOP09BN&lt;BR /&gt;  oracle 20786     1  0  Oct 22  ?         0:00 ora_reco_GPOP09BN&lt;BR /&gt;  oracle 22712     1  0  Oct 22  ?         6:06 ora_lgwr_BUS01BX&lt;BR /&gt;  oracle 22710     1  0  Oct 22  ?        35:54 ora_dbw0_BUS01BX&lt;BR /&gt;  oracle 20776     1  0  Oct 22  ?         2:25 ora_pmon_GPOP09BN&lt;BR /&gt;  oracle 20792     1  0  Oct 22  ?         0:08 ora_arc1_GPOP09BN&lt;BR /&gt;10:30 GPOP09BN hpbbnn1/home/oracle/&amp;gt; &lt;BR /&gt;&lt;BR /&gt;That's all folk.&lt;BR /&gt;Art</description>
      <pubDate>Thu, 27 Oct 2005 03:33:51 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/kill-command/m-p/3657416#M241504</guid>
      <dc:creator>Arturo Galbiati</dc:creator>
      <dc:date>2005-10-27T03:33:51Z</dc:date>
    </item>
    <item>
      <title>Re: Kill command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/kill-command/m-p/3657417#M241505</link>
      <description>1) ps -fu oracle|grep ora_|grep -v grep&lt;BR /&gt;2) ps -fu oracle|grep [o]ra_ &lt;BR /&gt;&lt;BR /&gt;I hope you may not get same for this too at all.&lt;BR /&gt;&lt;BR /&gt;grep is using matching regexp's. &lt;BR /&gt;&lt;BR /&gt;[o]ra_ or ora_ is same. You will get grep ora_ process in process list. If you are selecting all process then,&lt;BR /&gt;&lt;BR /&gt; # ps -efu oracle |grep -v grep | grep &lt;STRING&gt;&lt;BR /&gt;&lt;BR /&gt;If you know full string then,&lt;BR /&gt;&lt;BR /&gt; # UNIX95= ps -fu oracle -C telnetd&lt;BR /&gt;&lt;BR /&gt;If you are going to select few 10 process then, grep will not make any performance issue at all.&lt;BR /&gt;&lt;BR /&gt;-Muthu&lt;/STRING&gt;</description>
      <pubDate>Thu, 27 Oct 2005 05:06:54 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/kill-command/m-p/3657417#M241505</guid>
      <dc:creator>Muthukumar_5</dc:creator>
      <dc:date>2005-10-27T05:06:54Z</dc:date>
    </item>
    <item>
      <title>Re: Kill command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/kill-command/m-p/3657418#M241506</link>
      <description>grep is a really bad idea for searching ps output. For very unusual process names that are guarenteed never to be duplicated on the command line as a parameter (like in a grep command) or as a user or group ID, you can get away with using ps -e ... | grep something&lt;BR /&gt; &lt;BR /&gt;But let's suppose you want to get rid of all sh processes. If you do this:&lt;BR /&gt; &lt;BR /&gt;ps -ef | grep sh&lt;BR /&gt; &lt;BR /&gt;you will see some processes that you NEVER want to kill such as unhasdaemon. grep does not match a specific field, it matches anything on the line, so "grep sh" matches sh ksh csh bash unhasdaemon and even user or group names such sherry (who might be running vi on a critical file).&lt;BR /&gt; &lt;BR /&gt;ALWAYS use "ps -C inserverD" because this does not use grep. Instead, -C looks in the process table and does an EXACT match. It will not find inserverD123 or XinserverD. Now the -C option (and -H and -o) are XPG$ options and must be enabled with the temporary variable UNIX95. Just put the temp assignment in front of ps:&lt;BR /&gt; &lt;BR /&gt;UNIX95=1 ps -fC inserverD&lt;BR /&gt; &lt;BR /&gt;and magically, only inserverD processes will be found. This also finds any possible way of starting the process, from /inserver54_pro/bin/inserverD to ./inserverD and so on. Note that -C is much faster than -e and grep.&lt;BR /&gt; &lt;BR /&gt;Once you have the inserverD list, then you can kill the processes using kill -15 first, then kill -1 if any are left, and finally kill -9 if the first 2 do not work.</description>
      <pubDate>Thu, 27 Oct 2005 09:43:42 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/kill-command/m-p/3657418#M241506</guid>
      <dc:creator>Bill Hassell</dc:creator>
      <dc:date>2005-10-27T09:43:42Z</dc:date>
    </item>
  </channel>
</rss>

