Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I stopped using the Unix process ctr + z. Then I tried to kill the process and did not work. A friend from school was recommended to use the kill -9 process_id. What is the magic combination?

share|improve this question

migrated from stackoverflow.com May 18 '11 at 15:38

This question came from our site for professional and enthusiast programmers.

    
should go on superuser. –  Claudiu May 18 '11 at 15:37
    
    
Never trust "friend from school" recommendations, kill -9 process_id is quite a poor practice. –  jlliagre May 18 '11 at 20:19
    
@jlliagre so what would you suggest as the correct practice? –  slotishtype Jul 16 '11 at 11:56
    
"-9" or more precisely SIGKILL is a last resort signal, not something to routinely use. The correct practice for a suspended process is to first resume it as already answered. Should you want to kill it then, start by sending the "-15" signal (a.k.a SIGTERM) which give a chance for the process to exit gracefully. –  jlliagre Jul 16 '11 at 14:20
add comment

1 Answer

Just follow normal kill by a resume (SIGCONT or in shell, fg the job).

The signal will only be received after the process is resumed (it cannot receive the signal because... you suspended it :))

So,

kill -CONT $pid

to resume it if you no longer have access to the terminal or shell controlling the job

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.