nettop has a wide variety of uses, but it can be particularly helpful when trying to determine what is using the Macs internet connection and networking interfaces, what is communicating with what and how much data is being transferred, and it’s also just a great utility for network troubleshooting. Command line tools aren’t for everyone though, and for users who would like to view similar network information in a more traditional OS X app format,
进入控制界面后,把terminal的界面放到最大哦否则看不到全部信息
nettop
Once in nettop you can adjust the output a bit to see more or less information for specific processes and their network communications. Basic nettop commands are:
p – changes to and from human readable format (i.e.: kilobytes and megabytes rather than pure byte count)
d – show delta count (i.e.: active change in packet count rather than total packets
Up & Down arrow keys – navigate up and down in the list
Right & Left arrow keys – expand or collapse specific process or routing groups
q – quit out of nettop
Formatting is easy to follow, despite what the pasted sample block looks like below:
如果在输入阶段就需要过滤可以考虑的参数
-m Set the mode
Without any parameters, nettop will monitor all tcp and udp sockets.
tcp - only tcp sockets will be monitored
udp - only udp sockets will be monitored
route - instead of sockets, the routing table will be monitored
-n Disable address to name resolution
-c Be gentle on the CPU - draw less often