MacOS – How to kill a process using top on OS X

command linemacos

On other Unixe,s I can use top and then hit K and type the process ID.
How can I do that in OS X?

I can type kill [the_pid] on its own at the command line and that works. However, I was wondering if there was a way for it to happen while in the top program.

Best Answer

# top

press shift + s. This will bring up:

signal [TERM]:

At this point you can just press return for a 'polite' process end request ("signal 15") that will let the process clean up files, release memory, etc. For process that can't be killed this way, you can enter the word ‘kill’ which is signal "9" then press return.

Now top prompts for a pid (process id):

pid:

Enter the pid of the process you want to kill and that should take care of it.