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.

  • 1
    if you're on other *NIXes, you've probably already used htop. I find it to be more informative and consistent from machine to machine. It's available via MacPorts.
    – ephsmith
    Aug 15 '12 at 1:41
# 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):


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

  • 1
    I wouldn't use SIGKILL as the first choice. The suggested SIGTERM should do for most processes. SIGKILL terminates a process without any recourse or clean-up, possibly leaving a "zombie" process that still has open file descriptors, allocated memory, etc. Aug 16 '12 at 20:35
  • Thanks Jan. However I see no mention of SIGKILL in this answer. Presumably implied? Also if SIGTERM is a better option please state exactly what to type. Aug 26 '12 at 12:42
  • ok, I'll just update it myself. Aug 30 '12 at 15:38

From the top man page:

          Send  <sig>  to  <pid>.   <sig> can be specified either as a number or
          as a name (for example, HUP).  The default signal starts out as TERM.
          Each time a signal is  successfully  sent,  the default signal is updated
          to be that signal.  <pid> is a process id.

You must log in to answer this question.

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