4

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

Apache
  • 16,299

2 Answers2

2

Have you tried those options? From the man netstat page:

-c, --continuous
  This will cause netstat to print the selected information every second continuously. 
delay
  Netstat will cycle printing through statistics every delay seconds.

In your case, you can just write:

sudo netstat -cplant | grep emulator
m4573r
  • 5,701
-1

Try that in terminal:

netstat -tuonp
Jens Erat
  • 18,485
  • 14
  • 68
  • 80