0

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 netstat -lnp |grep 12239
4

1 回答 1

5

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.

于 2010-12-02T18:15:23.723 回答