How can I find the process id and stop the process that is running on port 8080 on a Mac?

On Ubuntu this works:

ps -aux

and I can find the process and run:

kill -9 pid

ps -aux didn't seem to work, how can I do this on Mac OS X Lion?

link|improve this question

57% accept rate
2  
No. No. No. Please, please, please do not use kill -9 pid until after you've tried just kill pid. Many processes will have signal handlers which will clean up their use of resources, cleanly close connections and other pre-shutdown tasks. If you kill with -9, the process dies immediately without doing the cleanup. Killing without -9 will work most of the time. – Doug Harris Jan 30 at 19:00
feedback

2 Answers

For historical reasons, ps's options are a tangled and inconsistent mess. On OS X Lion, any of these should work:

ps -ax
ps -e
ps aux # this displays in a different format

I don't have an ubuntu box handy to test, but according to the man page, ps -aux isn't the right way to do it there either:

Note that "ps -aux" is distinct from "ps aux". The POSIX and UNIX
standards require that "ps -aux" print all processes owned by a user
named "x", as well as printing all processes that would be selected by
the -a option. If the user named "x" does not exist, this ps may
interpret the command as "ps aux" instead and print a warning. This
behavior is intended to aid in transitioning old scripts and habits. It
is fragile, subject to change, and thus should not be relied upon.
link|improve this answer
feedback

Use Activity Monitor.

Applications -> Utilities -> Activity Monitor

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.