开发者

Ubuntu netstat command - howto keep it updating?

I know there is a way to run a netstat command on ubuntu so that it keeps updating. Does anyone know? I would like to know when a process opens or closes a socket:

sudo ne开发者_如何学运维tstat -lnp |grep 12239


You can wrap any command in watch, eg try

 watch -n 60 "sudo netstat | head 10"

where you could use your grep expression instead of head 10. This now updates every 60 seconds, see man watch.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜