Saturday, November 28, 2009

Force Quiting Applications From Command Line

 I didnt know how to force Quit applications from the command line. Yesterday my friend(Ravi Jaya) taught me how to..!


$pgrep process_name (Type this in the command line, So the output will be the process id)


pid: 1245 (this is the process id)




$sudo kill -9 1245 (This command will force quit the application.

7 comments:

  1. It was you who taught me how to..!
    Thanks..

    ReplyDelete
  2. Try xkill, when pkill doesnt work.
    Type #pkill and use TAB completion to complete.
    No need to find process-id,

    ReplyDelete
  3. pkill would kill all the instance of the specified process.

    ReplyDelete
  4. $ps ax

    It will show all the running processes with its pid.

    now , $ kill pid

    and to one more way is (eg) $ killall firefox.
    It will kill the running firefox applications.


    :-)

    ReplyDelete
  5. it is good to learn all the KILL sigs.

    Have you tried the kill -HUP, very useful in production environment where sys admins need to maintain 99.99999 avail.

    ReplyDelete
  6. You could always use
    killall -r [process_name]
    to kill all the instances of the process

    ReplyDelete