LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 02-09-2004, 09:20 AM   #1
demmylls
Member
 
Registered: Aug 2003
Location: AT
Distribution: Fedora Core 3
Posts: 404

Rep: Reputation: 30
kill program command line


how to kill program or running process from command line?
for example i want to kill "gdm"
 
Old 02-09-2004, 09:29 AM   #2
snacky
Member
 
Registered: Feb 2004
Distribution: Debian
Posts: 286

Rep: Reputation: 30
gdm is a bit of a special case. You will want to change your runlevel to 4 (or 3, depending on how your system is set up) to stop using it. This change can be put into effect permanently by editing /etc/inittab and changing the line that probably says
id:5:initdefault:
to
id:4:initdefault:

Otherwise the problem can be fixed with "killall gdm". Currently that would probably cause it to respawn, though.
 
Old 02-09-2004, 09:30 AM   #3
Unseen
Member
 
Registered: Feb 2003
Distribution: debian
Posts: 56

Rep: Reputation: 15
gdm will continue to spawn itself over and over after being killed You will want to boot into a different runlevel to have it not automatically launch gdm for you.

To kill items you can just "kill X" where X is the PID of the program. You can also do "kill -9 X" to force the programe to shut down.

Alternatively, if you have 5 instances of a program running you can use the command killall which will kill all instances of the program you name.
 
Old 02-09-2004, 09:42 AM   #4
demmylls
Member
 
Registered: Aug 2003
Location: AT
Distribution: Fedora Core 3
Posts: 404

Original Poster
Rep: Reputation: 30
what is respawn?
there is one i got this msg from new kernel 2.6 (which is unsuccessfully compiled) saying
respawn and must wait 5 minutes


how to know what process names that are running so that i wil know whichone to kill?
 
Old 02-09-2004, 09:49 AM   #5
jazernorth
Member
 
Registered: Jan 2004
Location: Green Bay
Distribution: RedHat 8.0, LFS-5.0
Posts: 100

Rep: Reputation: 15
Kill should be your last resort. You should use
Code:
/etc/init.d/<program name> stop
. Kill does not go through any process closures. Any open files will not be closed correctly and can cause headaches. So, use kill cautiously.

Enoy.

JN
 
Old 02-09-2004, 12:07 PM   #6
mikshaw
LQ Addict
 
Registered: Dec 2003
Location: Maine, USA
Distribution: Slackware/SuSE/DSL
Posts: 1,320

Rep: Reputation: 45
Quote:
Originally posted by jazernorth
Kill should be your last resort. You should use
Code:
/etc/init.d/<program name> stop
This only works on startup processes...do you know of a way to do this with other processes? What I generally use, in a script anyway, is
Code:
kill -9 `ps h -C <program name> | awk '{print $1}'`
but it's a bit excessive for a command line
 
Old 02-09-2004, 01:41 PM   #7
demmylls
Member
 
Registered: Aug 2003
Location: AT
Distribution: Fedora Core 3
Posts: 404

Original Poster
Rep: Reputation: 30
how to display what is displayed in redhat9 "kstart/system tools/system monitor" under shell?
so that i can know that the process name is to kill
 
Old 02-09-2004, 08:55 PM   #8
mikshaw
LQ Addict
 
Registered: Dec 2003
Location: Maine, USA
Distribution: Slackware/SuSE/DSL
Posts: 1,320

Rep: Reputation: 45
top works, and so does ps
Best thing for me is "ps -C commandname"
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Kill specific Wine program from Command Line Brian114 Linux - Software 4 06-07-2011 04:02 AM
How to kill an idle user via the command line? goemon Linux - General 7 12-01-2005 06:01 PM
Please dont kill me for asking.. Command line? (I AM i n00b) Nox_hand Linux - Newbie 17 09-17-2005 03:59 PM
How can I see what process are running and how to I kill them? (command line). brynjarh Linux - Newbie 4 07-07-2004 03:01 PM
one-line kill command using process name julianop Linux - Newbie 6 12-22-2003 11:33 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 12:49 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