开发者

Ubuntu netstat command - howto keep it updating?

开发者 https://www.devze.com 2023-01-28 19:00 出处:网络
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:

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

精彩评论

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