I am running a program in the terminal that I can't escape with Ctrl-C and that I want to kill. How can I find its PID?
Open another terminal and run
The first field of each line of output is a number which represents the Process ID of the program matched by
To halt the offending process, do:
If you are running a graphical interface, of course, you don't have to fool with this crazy command-line stuff to get the job done. Just open "System Monitor", navigate to the Processes tab, choose the process you want to halt (Hm, could it be the one using 90% CPU?) and right-click it. Since the process is already stopped, (that's the problem, right?) choose End Process or Kill Process from the resulting menu.
I have found it is nice to use a case insensitive search by adding the "-i" and using "aux" instead of "ax" to get a more descriptive output:
If you would like to kill all the processes you may use:
That is a forceful kill. Drop the "-9" if you want a soft kill.