On Linux, I can use netstat -pntl | grep $PORT
or fuser -n tcp $PORT
to find out which process (PID) is listening on the specified TCP port. How do I get the same information on Mac OS X?
相关问题
- Xcode debugger displays incorrect values for varia
- Is there a way to report errors in Apple documenta
- Advice for supporting both Mac and Windows Desktop
- Avoid cmake to add the flags -search_paths_first a
- installing packages for python 3
相关文章
- 现在使用swift开发ios应用好还是swift?
- Socket编程 TCP方式发送时间有点长
- Visual Studio Code, MAC OS X, OmniSharp server is
- xcode 4 garbage collection removed?
- IntelliJ IDEA can't open projects or add SDK o
- Automator: How do I use the Choose from List actio
- ImportError: No module named twisted.persisted.sty
- How can I vertically align my status bar item text
This works in Mavericks (OSX 10.9.2).
Since Yosemite (10.10), up to Mojave (10.14), every version of macOS supports this:
I am a Linux guy. In Linux it is extremely easy with
netstat -ltpn
or any combination of those letters. But in Mac OS Xnetstat -an | grep LISTEN
is the most humane. Others are very ugly and very difficult to remember when troubleshooting.This is a good way on macOS High Sierra:
I made a small script to see not only who is listening where but also to display established connections and to which countries. Works on OSX Siera
This may be useful to check if you are connected to north-korea! ;-)
Inspired by user Brent Self:
lsof -i 4 -a | grep LISTEN