There are multiple ways to do it.
I will post the most common CLI methods.
Firstly the
kill command.You can use
kill to terminate a process that is being run by you, or if logged in as root or using sudo you can kill a program run by anybody.kill has many uses but I will only post the most simple one.To kill a process using
kill you must first have its PID (process ID). To get this you can use the command
pidof.You may then
kill the process.For instance;
if
bash$ pidof [process] gives
[output]then you can
bash$ kill [output]which will end process
[process]For instance:
bash$ pidof rhythmbox 2531bash$ kill 2531would be used to kill rhythmbox
This is a rather long method however.
This is where the comand
killall comes in.You do not need to use the PID when using
killall.You can simply use:
bash$ killall [process]and the process will be killed.
For instance:
bash$ killall rhythmboxThere is another option which lets you see if a program is misbehaving and kill it called
Top.When in a shell simply type:
bash$ topYou get a CLI task manager which shows PID's and cpu usage etc.
Example:
bash$ topgives me this:
You can kill a process by pressing 'k' then typing in the PID listed for it.
eg:
PID to kill: 2531it will ask you:
Kill PID 2531 with signal [15]: and you can simply press enter to kill it or ^C (ctrl+C) to exit the program.
