Continuously check nestat output for a particular program

Posted by Vihaan Verma on Super User See other posts from Super User or by Vihaan Verma
Published on 2012-09-07T07:38:39Z Indexed on 2012/09/07 9:40 UTC
Read the original article Hit count: 251

Filed under:
|
|

I have a android emulator running on port 5554. I want to continuously watch the netstat output concerning emulator stuff.

right now I have to manually execute this command every time

sudo netstat -plant | grep emulator

I thought doing something like this would repeat above command automatically every 2 sec.

watch sudo netstat -plant | grep emulator

but instead it hangs the terminal. How to achieve such functionality ? Thanks

© Super User or respective owner

Related posts about grep

Related posts about netstat