Help answer threads with 0 replies.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


  Search this Thread
Old 03-12-2003, 11:48 PM   #1
Registered: Feb 2003
Location: Phoenix, AZ - USA
Distribution: RedHat 8, Micro$haft
Posts: 33

Rep: Reputation: 15
Question Setting and killing processes?

Two questions please...

How can I kill a process using it's name, vise it's process ID? If I have five instances of "myscript" running, I'd like to kill all of them using their name and not the idividual PIDs as I can't see any other way to do it.

Can I specify a parameter in a bash script that will always give it the same process ID ever time it is run (and possibly die out if a process w/ that ID is already running). I'd like to set my bash script to always have PID 20000 or something.

Thanks in advance!!
Old 03-13-2003, 05:09 AM   #2
LQ Newbie
Registered: Mar 2003
Posts: 5

Rep: Reputation: 0
In case of problem 1, try
killall myscript
This gracefully kills all myscript instances.
Enjoy !!! Penguin
Old 03-13-2003, 06:32 AM   #3
Registered: Sep 2002
Location: .at
Distribution: SuSE, Knoppix
Posts: 532

Rep: Reputation: 31
2) no, you can't , PIDs are generated by the kernel when a process is started and PID numbers cannot be selected by a user process
Old 03-15-2003, 07:37 PM   #4
Registered: Feb 2003
Location: Phoenix, AZ - USA
Distribution: RedHat 8, Micro$haft
Posts: 33

Original Poster
Rep: Reputation: 15
Very helpful to my problem. Thank you very much for your help.



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
Killing running processes hitest SUSE / openSUSE 4 09-03-2005 02:22 PM
Killing processes hongman Linux - Newbie 3 02-28-2005 05:27 PM
killing all of a user's processes thebeaglebeagle Linux - Software 1 09-04-2003 11:33 AM
killing processes adriaanbw Linux - Software 3 05-24-2003 10:46 PM
Vm: Killing Processes tbhebe Linux - General 3 03-07-2002 09:51 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 05:28 AM.

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