{"title": "\u4f7f\u7528nethogs\u76d1\u63a7Linux\u7cfb\u7edf\u6d41\u91cf", "update_time": "2013-10-23 13:50:02", "tags": "nethogs", "pid": "264", "icon": "linux.png"}
nethogs是一个可以在Linux下监控进程流量的工具,非常不错。 ## 安装方法 CentOS的默认rpm仓库里没有nethogs的包,需要我们通过编译来实现安装。nethogs编译依赖2个库,在编译前也要安装一下。 ``` #安装编译nethogs的依赖包 yum install libpcap libpcap-devel #下载nethogs最新版 wget 'http://downloads.sourceforge.net/project/nethogs/nethogs/0.8/nethogs-0.8.0.tar.gz' tar -xzvf nethogs-0.8.0.tar.gz cd nethogs make && make install #默认安装好后的路径是/usr/local/sbin/nethogs ``` ## 运行 不输入任何参数即可运行 ``` nethogs ``` 按q就可以退出 参数帮助 ``` [root@opstool ~]$ /usr/local/sbin/nethogs --help /usr/local/sbin/nethogs: invalid option -- - usage: nethogs [-V] [-b] [-d seconds] [-t] [-p] [device [device [device ...]]] -V : prints version. -d : delay for update refresh rate in seconds. default is 1. -t : tracemode. -b : bughunt mode - implies tracemode. -p : sniff in promiscious mode (not recommended). device : device(s) to monitor. default is eth0 ```