How to kill a process when I cant kill it via the GUI and kill in the terminal?

I have some weird Skype crashes today. If I try to close it via the X nothing happens. I tried to kill the process over the KDE Process Manager (Ctrl+ESC).

I even tried to kill Skype via the terminal:

killall skype
kill (skypes process number)

None of the both worked. Right now I got to relogin to get it working again, and it keeps crashing every 15mins. I'm using KDE 4.7 and Ubuntu 11.10.


These days killall will also let you pass in a signal (to save you needing to look up a PID):

killall -9 skype

use this :

kill -9 $(pgrep skype)


To kill a process/application in a Terminal type

$ ps -e | grep skype

this will show the skype process ID

e.g, it shows,

2338 ?        00:00:33 skype

type

$ kill 2338

in GUI configure a short cut key for xKill, (like I have configured to Ctrl + Alt + Bkspace) once you will press the combination, you will get a small cross symbol X instead of mouse cursor .... select the application window with that cross cursor with mouse and it will kill that application.


I automated all this:

  1. Made a stop-skype.sh file which contained:
    #!/bin/bash
    #stop-skype.sh
    kill $(ps aux | grep '[s]kype' | awk '{print $2}')
  1. Made this file executeable

  2. In /usr/share/applications, made skype-shutdown.desktop containing:

[Desktop Entry]
Name=Skype Shutdown
Comment=Shut down Skype running in the background
Exec=/home/volker/stop-skype.sh
Icon=/home/volker/stop-skype.png
Terminal=false
Type=Application
Categories=Application;
  1. Made a stop-skype.png file which you can download from http://www.freemed.info/.download/stop-skype.png

  2. Opened Files and dragged the /usr/share/applications/skype-shutdown.desktop to Cairo Dock.

This resulted in an icon on which one can click to stop all Skype processes.

See: http://www.freemed.info/.download/Skype-shutdown.png