LinuxQuestions.org
Visit Jeremy's Blog.
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 10-18-2004, 09:24 AM   #1
chunlee
Member
 
Registered: Jun 2004
Location: london
Distribution: gentoo
Posts: 114

Rep: Reputation: 15
kill command question


hi there:

i was going through a tutorial in using the shell and got a question about the "kill" command

in my terminal, i got
PID TTY TIME CMD
3242 pts/13 00:00:00 bash
3260 pts/13 00:00:00 man
3263 pts/13 00:00:00 sh
3264 pts/13 00:00:00 sh
3268 pts/13 00:00:00 less
3359 pts/13 00:00:00 ps

then i typed:

kill 3260

and nothing happened, no messages or errors and i just got another prompt in a new line, and when i do another ps, i have not killed anything with my kill command.

i am sure it really simple, but i am quite confused with this just now.

many thanks

yours

CHUN
 
Old 10-18-2004, 09:38 AM   #2
SciYro
Senior Member
 
Registered: Oct 2003
Location: hopefully not here
Distribution: Gentoo
Posts: 2,038

Rep: Reputation: 51
kill/killall send a signal to the process which is pretty much saying "please terminate" .. ... so if a program was made so it doesn't listen to the signals, asking it wont do a think

other programs can sometimes get messed up (like freeze or are just waiting .. for something)

anyways, to force the termination of a stray process use the "-9" option

like

kill -9 3260

that will force it to quit, it wont even ask the program to quit .... kinda a mean thing thing to do, so be sure to use "kill 3260" first, to give it a chance
 
Old 10-18-2004, 09:44 AM   #3
sidra
Member
 
Registered: Oct 2004
Location: USA
Distribution: Fedora Core 3, Red Hat 9, CentOS 4.2, Mandriva, Ret Hat Enterprise Linux 4.0
Posts: 116

Rep: Reputation: 15
Try this

Hi,

When you did a kill and then a ps the next time the process you killed should not have been there. Check this out. Do a:

ps -A

The -A option lists all the running processes and not just those on the terminal. Then try doing:

kill pid

where pid is the pid of any of the running processes. Then do a:

ps -A again to see if that process is listed. It shouldn't be. I just checked this out and it worked.

Hope this helps
 
Old 10-18-2004, 11:47 AM   #4
chunlee
Member
 
Registered: Jun 2004
Location: london
Distribution: gentoo
Posts: 114

Original Poster
Rep: Reputation: 15
hi there:

thanks, i think the -9 option was what i was looking for.

cheers

CHUN
 
Old 10-18-2004, 01:03 PM   #5
sidra
Member
 
Registered: Oct 2004
Location: USA
Distribution: Fedora Core 3, Red Hat 9, CentOS 4.2, Mandriva, Ret Hat Enterprise Linux 4.0
Posts: 116

Rep: Reputation: 15
Try this too

Hey,

In case you haven't already checked it out, type :

kill -l
(that is a small L)

This shows a list of all the signals possible. So the -9 you're using you'll see is SIGKILL...which is sent when you do kill -9 pid.....this is a signal which cannot be caught!

 
Old 10-18-2004, 01:45 PM   #6
chunlee
Member
 
Registered: Jun 2004
Location: london
Distribution: gentoo
Posts: 114

Original Poster
Rep: Reputation: 15
in there:

thanks, i will look into that. just got a book called "Linux system commands" by Patrick Volkerding. so i am realy to dive into the world of commands.......

CHUN
 
  


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
Question about Kill command bjdea1 Linux - General 2 11-07-2005 11:28 AM
Kill command could not kill Kanaflloric Linux - General 11 08-22-2005 08:18 AM
The kill command tearinox Linux - Newbie 2 08-15-2003 05:40 PM
Kill a process by command ITJedi Programming 3 03-07-2003 11:49 AM
kill command... Sonny Linux - Newbie 2 01-28-2002 04:08 AM


All times are GMT -5. The time now is 10:38 PM.

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