nettop加指令

Mac OS X includes an excellent command line network utility called “nettop” that allows users to monitor all network activity, traffic, and routes from a Mac to the outside world, both through local (LAN) and wide area (WAN) connections. If you’re unfamiliar with networking tools like this, you can think of nettop as a network centric task manager, displaying active networking connections, sockets and routes, their respective names and process id, the state of the connection and whether the connection is established, waiting, or listening, and information about individual process data transfer. It’s a bit like the standard ‘top’ and ‘htop’ commands which show process and resource information, but rather than showing CPU and RAM usage, it will show live network transfer information like packets sent and received, packet size, and total data transferred.

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

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值