In Windows by using Task Manager
we can see how many .exe
files are running. Also in command prompt
we use tasklist
command to see processes. In ubuntu how can I see all processes and kill unwanted processes?
In Windows by using Task Manager
we can see how many .exe
files are running. Also in command prompt
we use tasklist
command to see processes. In ubuntu how can I see all processes and kill unwanted processes?
From the terminal,
ps -ef
will list all the processes. Seeman ps
. Seeman kill
,man 2 kill
,man killall
,man nice
,man pkill
,man renice
,man 7 signal
, andman skill
to mess with processes. However, simply killing a process that you think is useless may be a mistake. The system might restart the process, or something you depend on might depend on the process you killed. Learn what the processes do, and look at/etc/init/
and/etc/init.d
,/etc/rc?.d
,man service
to see how processes are started by the system.Using GUI, you can use System Monitor
Or from terminal you can use
To view every process:
All processes running by a user:
To kill a process, either find the process name and type:
or kill the process ID (PID):
Stop/suspend a process:
Source:Man Page
There is also the tool "htop". It is like "top", but has lots of other capabilities.
In a terminal enter:
My main tool here is
top
type
top
at the command line in a terminal windowYou'll get a list of the process that are running, listed by cpu usage. Wait a few seconds for it to gather more stats before proceeding.
This is my main tool in unix for killing runaway or unwanted processes. They are likely to be near the top of the list. Note their pid and press
q
and then either 15 (soft kill) or 9 (hard kill).Here you see me killing a Chrome process:
The process should go away. Then type
q
to quit out of top.If you find you are always killing the same processes you can also use
kill
orkillall
at the command line, for instance iftop
has shown several java programs taking up cpu you canq
uit out of top and dokillall java
kill
andkillall
use 15 (SIGTERM) by default but you can override this withkillall -9 [process]
orkillall -s SIGKILL [process]
Another good tool to use will be Glances.