Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

On linux I can kill a process knowing only the port it is listening on using fuser -k 9000/tcp, how do I so the same on MacOS?

share|improve this question

1 Answer 1

up vote 3 down vote accepted
lsof -P | grep ':NumberOfPort' | awk '{print $2}' | xargs kill

Change NumberOfPort to the actual port you want to search for.

share|improve this answer
1  
I just had to add -9 to the end to get this to work, but I believe that is due to the nature of the listening application and not generally recommended practice, to kill -9 that is. –  Kris Jul 24 '12 at 7:37
    
@Kris - lsof -P | grep ':NumberOfPort' | awk '{print $2}' | xargs kill -9 worked! –  aces. Jan 18 '13 at 15:56

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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