LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 12-02-2008, 11:02 AM   #1
yusufs
Member
 
Registered: Oct 2007
Posts: 162

Rep: Reputation: 30
kill process


Dear all,

in the below ouput,

db1racle:/application/oracle$ ps -ef | grep LOCAL=NO
oracle 23294 1 0 00:31:42 ? 0:02 oracleJOIK (LOCAL=NO)
oracle 11714 1 0 01:38:40 ? 0:00 oracleJOIK (LOCAL=NO)
oracle 18323 1 0 16:45:35 ? 0:00 oracleJOIK (LOCAL=NO)
oracle 23372 1 0 00:31:45 ? 0:00 oracleJOIK (LOCAL=NO)
oracle 4150 1 0 23:49:20 ? 0:19 oracleJOIK (LOCAL=NO)
oracle 14113 1 0 18:51:04 ? 0:12 oracleJOIK (LOCAL=NO)
oracle 23146 1 0 00:31:34 ? 2:05 oracleJOIK (LOCAL=NO)
oracle 19327 1 0 01:19:38 ? 3:14 oracleJOIK (LOCAL=NO)
oracle 27247 1 0 18:36:24 ? 0:00 oracleJOIK (LOCAL=NO)
oracle 16701 1 0 12:28:42 ? 0:00 oracleJOIK (LOCAL=NO)
oracle 23144 1 0 00:31:34 ? 2:09 oracleJOIK (LOCAL=NO)
oracle 27024 1 0 17:44:38 ? 0:02 oracleJOIK (LOCAL=NO)
oracle 23336 1 0 00:31:45 ? 0:00 oracleJOIK (LOCAL=NO)
oracle 14604 1 0 18:51:22 ? 0:06 oracleJOIK (LOCAL=NO)
oracle 19343 1 0 01:19:39 ? 2:51 oracleJOIK (LOCAL=NO)
oracle 13318 1 0 18:50:22 ? 0:00 oracleJOIK (LOCAL=NO)
oracle 16843 1 0 12:28:52 ? 0:00 oracleJOIK (LOCAL=NO)
oracle 23326 1 0 00:31:44 ? 0:00 oracleJOIK (LOCAL=NO)
oracle 14111 1 1 18:51:04 ? 0:20 oracleJOIK (LOCAL=NO)
oracle 4160 1 0 23:49:20 ? 0:16 oracleJOIK (LOCAL=NO)


How can I kill all the process with LOCAL=No in a single command ...instead of killing each and every individual local=no..


Yusuf
 
Old 12-02-2008, 11:37 AM   #2
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 17,950

Rep: Reputation: 3693Reputation: 3693Reputation: 3693Reputation: 3693Reputation: 3693Reputation: 3693Reputation: 3693Reputation: 3693Reputation: 3693Reputation: 3693Reputation: 3693
Quote:
Originally Posted by yusufs View Post
Dear all,

in the below ouput,

db1racle:/application/oracle$ ps -ef | grep LOCAL=NO
oracle 23294 1 0 00:31:42 ? 0:02 oracleJOIK (LOCAL=NO)
oracle 11714 1 0 01:38:40 ? 0:00 oracleJOIK (LOCAL=NO)
oracle 18323 1 0 16:45:35 ? 0:00 oracleJOIK (LOCAL=NO)
oracle 23372 1 0 00:31:45 ? 0:00 oracleJOIK (LOCAL=NO)
oracle 4150 1 0 23:49:20 ? 0:19 oracleJOIK (LOCAL=NO)
oracle 14113 1 0 18:51:04 ? 0:12 oracleJOIK (LOCAL=NO)
oracle 23146 1 0 00:31:34 ? 2:05 oracleJOIK (LOCAL=NO)
oracle 19327 1 0 01:19:38 ? 3:14 oracleJOIK (LOCAL=NO)
oracle 27247 1 0 18:36:24 ? 0:00 oracleJOIK (LOCAL=NO)
oracle 16701 1 0 12:28:42 ? 0:00 oracleJOIK (LOCAL=NO)
oracle 23144 1 0 00:31:34 ? 2:09 oracleJOIK (LOCAL=NO)
oracle 27024 1 0 17:44:38 ? 0:02 oracleJOIK (LOCAL=NO)
oracle 23336 1 0 00:31:45 ? 0:00 oracleJOIK (LOCAL=NO)
oracle 14604 1 0 18:51:22 ? 0:06 oracleJOIK (LOCAL=NO)
oracle 19343 1 0 01:19:39 ? 2:51 oracleJOIK (LOCAL=NO)
oracle 13318 1 0 18:50:22 ? 0:00 oracleJOIK (LOCAL=NO)
oracle 16843 1 0 12:28:52 ? 0:00 oracleJOIK (LOCAL=NO)
oracle 23326 1 0 00:31:44 ? 0:00 oracleJOIK (LOCAL=NO)
oracle 14111 1 1 18:51:04 ? 0:20 oracleJOIK (LOCAL=NO)
oracle 4160 1 0 23:49:20 ? 0:16 oracleJOIK (LOCAL=NO)


How can I kill all the process with LOCAL=No in a single command ...instead of killing each and every individual local=no..


Yusuf
Check out the killall command.

http://linux.die.net/man/1/killall
 
Old 12-02-2008, 11:38 AM   #3
jstephens84
Senior Member
 
Registered: Sep 2004
Location: Nashville
Distribution: Manjaro, RHEL, CentOS
Posts: 2,098

Rep: Reputation: 102Reputation: 102
Try using the killall -HUP command.
Code:
killall -HUP oracle
# Man, I was too slow today. #
 
Old 12-05-2008, 09:59 AM   #4
yusufs
Member
 
Registered: Oct 2007
Posts: 162

Original Poster
Rep: Reputation: 30
Quote:
Originally Posted by jstephens84 View Post
Try using the killall -HUP command.
Code:
killall -HUP oracle
# Man, I was too slow today. #


Thanks Friends for your answers..

db01racle:/aplication/oracle$ ps -ef | grep db1 | grep LOCAL=NO | more
oracle 961 1 0 17:17:33 ? 0:01 oracledb1 (LOCAL=NO)
oracle 25076 1 0 09:45:13 ? 0:03 oracledb1 (LOCAL=NO)
oracle 18971 1 0 21:19:36 ? 0:00 oracledb1 (LOCAL=NO)
oracle 27333 1 0 16:00:59 ? 0:28 oracledb1 (LOCAL=NO)
oracle 24352 1 0 15:58:23 ? 0:00 oracledb1 (LOCAL=NO)
oracle 4524 1 0 16:55:49 ? 0:01 oracledb1 (LOCAL=NO)
oracle 13029 1 0 21:14:47 ? 0:00 oracledb1 (LOCAL=NO)
oracle 15362 1 0 21:16:37 ? 0:00 oracledb1 (LOCAL=NO)
oracle 27437 1 0 17:14:44 ? 0:00 oracledb1 (LOCAL=NO)
oracle 21022 1 0 15:55:54 ? 0:00 oracledb1 (LOCAL=NO)
oracle 21429 1 0 17:09:52 ? 0:06 oracledb1 (LOCAL=NO)
oracle 24931 1 0 16:23:30 ? 0:16 oracledb1 (LOCAL=NO)
oracle 11921 1 0 16:12:44 ? 0:02 oracledb1 (LOCAL=NO)
oracle 6946 1 0 17:22:31 ? 0:02 oracledb1 (LOCAL=NO)



I have more than 200 process like this.. I want to kill all the process which are started before 8 hours.. let say the time now is
5Pm.. I need to delete all the process with LOCAL=No till time 10AM....is there anyway I can do this in a single command ?


Thanks in advance
 
Old 12-05-2008, 01:42 PM   #5
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 17,950

Rep: Reputation: 3693Reputation: 3693Reputation: 3693Reputation: 3693Reputation: 3693Reputation: 3693Reputation: 3693Reputation: 3693Reputation: 3693Reputation: 3693Reputation: 3693
Quote:
Originally Posted by yusufs View Post
Thanks Friends for your answers..
I have more than 200 process like this.. I want to kill all the process which are started before 8 hours.. let say the time now is
5Pm.. I need to delete all the process with LOCAL=No till time 10AM....is there anyway I can do this in a single command ?
Not unless you write some sort of regex, and can pass it through to killall. Don't know if time shows up, or if it's just the PID.

Best way to do it would be with a small shell script...run the ps command into grep for oracle. Check the time, and if it's greater than 8 hours from current time, kill it.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to get the PID of the process giving kill signal to a process? hariprd Programming 2 11-27-2008 04:10 AM
Shell Script : Kill a running process when another process starts ashmew2 Linux - General 3 08-20-2008 04:47 AM
Kill process via name keysorsoze Linux - General 2 11-25-2006 11:37 PM
cannot kill process (kill -9 does not work) mazer13a Linux - General 1 05-27-2005 03:32 PM
kill a process bratch Linux - Software 9 04-13-2005 07:00 PM


All times are GMT -5. The time now is 02:26 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration