84

I have been playing around with Ubuntu installing new themes and and docks. Sometimes during the installation, whole screen just hangs. What is the best way in Ubuntu to Kill a process/application? Anything similar to Ctrl + Alt + Del of windows?

1
  • 6
    You'll want to be careful when killing installation processes. It can leave your machine in an inconsistent state. While this may not be such a big deal when installing customization packages, you'll want to make sure that you're not doing something akin to a kernel upgrade at the same time! (I've fragged an Ubuntu installation doing this) Nov 16, 2010 at 6:10

10 Answers 10

114

Not quite like CtrlAltDel of Windows, but you can also kill with xkill. Just go to the "run" dialog (Alt+F2), type in xkill and your mouse pointer will change to an "x". Point on the application that you want to kill and click, and it'll be killed. Can sometimes be much quicker than loading the System Monitor.

4
  • 7
    If you change your mind, you can right click to cancel xkill.
    – wisbucky
    Sep 12, 2017 at 5:14
  • 1
    Does xkill need to be installed first?
    – Cactus
    Jul 20, 2018 at 13:29
  • Alt+F2 does not open the run dialog for me, but reduces sound volume. Using Ubuntu 18.04.1 on a Dell laptop. Dec 24, 2018 at 12:21
  • 1
    @SanderHeinsalu Just press Alt + F2 + Fn keys Apr 14, 2021 at 18:47
73

In System->Admin you have an application called System Monitor, this is the equivalent of the windows task manager.

Edit: for later versions of Ubuntu (writing this on a PC running 13.10), you will find the system monitor through the dash (top left). Just type system monitor or parts of it in the dash and look for the System Monitor application..

alt text

2
  • 4
    I usually bind it to the CTRL+ESC combo as soon as I finish installing the SO. You can bind it to any combo using System->Preferences->Keyboard Shorcuts. Nov 16, 2010 at 10:40
  • Have to install the System Monitor first. It was not installed by default when updating to Ubuntu 18.04.1 from 16.04.1 and switching to a Gnome desktop. Dec 24, 2018 at 12:24
14

This is my personal list of killing:

  • kill <pid_number> example: kill 8888 effect: kill application that has PID 8888.
  • kill -9 <pid_number> example: kill -9 8888 effect: same with above but more extreme and forceful.
  • killall <application_name> example killall firefox effect: kill application or application instance that has name firefox. You don't have to know PID number, and this is my most favorite.
  • kill -9 -1 effect: kill all processes including X Server so you can go back to display manager (LightDM, GDM, or KDM). Another name for this command is relogin. And this command is a substution for clicking Log Out button.
  • Alt+Printscreen+REISUB effect: force restart; same with Ctrl+Alt+Del in Windows. It is very useful to avoid HDD damage.
  • Alt+Printscreen+REISUO effect: force shutdown, like Ctrl+Alt+Del but do shutdown instead of restart. Only differ 1 last char (O and B).
  • xkill effect: change your pointer to skull. If you click a GUI Windows with that, the Window will definitely be die.

You can see PID of a process by commands ps aux, top, htop, or graphically by GNOME System Monitor.

0
7

Firstly you should know the PID of the application you want to kill.

you can use ps to get this.

ps aux | grep "$appName" | grep -v 'grep'

Then use kill.(Ensure you have the privilege to kill it.)

kill  "$PID"
2
  • 2
    pkill might also be useful here.
    – Broam
    Nov 16, 2010 at 18:55
  • @Broam :Yes,pgrepcan also list the PID of application.
    – kit.yang
    Nov 17, 2010 at 1:13
6

If your screen hangs, you can switch to virtual console (Alt-Ctrl-F1), login with your user, type top, detect CPU eating process, and then run skill process_name. If it is system (root) process, use sudo skill process_name

2
  • Extender, Alt-Ctrl-F1 isnt working.
    – t3ch
    Nov 16, 2010 at 12:15
  • In that case, press Alt-PrtScr-K (you will lost unsaved docs, as your session will be restarted)
    – Extender
    Nov 16, 2010 at 16:08
5

You can use tty by pressing Ctrl+ Alt+ F2 and then login and run following command:-

kill -9 -1

From man kill,

kill -9 -1
       Kill all processes you can kill.

This will return to login screen and after login all process works freshly.

3

If you right click on the Gnome panel, and choose "Add to Panel", on the list you'll find a "Force Quit" button. If you add that to the panel, you can click on it, and then on an unresponsive program, to kill it.

You might also want to learn about the kill and killall command line programs.

0
3

You can also restart X.Type Ctrl+Alt+Backspace

In ubuntu 10.04 these keys will be disabled by default.To enable it,

  • Goto System-->Preferences-->Keyboard

  • Select the Layouts tab and click on the Options button.

  • Select Key sequence to kill the X server and enable Control + Alt + Backspace.

1

Also a quick hot key combination using GUI method works with my Ubuntu 14.04 (xfce) just press Ctrl+Alt+Esc and an xkill cursor should appear, just click on an application to kill.

1

Open the terminal and type:

pkill <application_name>  

where <application_name> is replaced by the name of the application in the command which is used to start the application from the terminal. If you don't know the process name of an application you can look it up in the System Monitor.

1
  • Oops! sorry for the typo and +1.
    – Error404
    Feb 1, 2022 at 8:24

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .