2

I am looking for a non-deprecated way of running a command like netstat -tulpn | grep 8000 to output information about an active port. Any suggestions on how to use a tool like ss to get the process id?

I have a localhost running on port 8000, but ss -a | grep 8000 does not output anything. Running fuser 8000/tcp outputs the port's process, as does netstat -tulpn | grep 8000. Why doesn't the ss command output anything about my port?

modulitos
  • 335
  • 1
  • 3
  • 16
  • Does `ss -na | grep 8000` output something ? What kind of information would you like to retrieve about an active port ? – krisFR May 20 '15 at 09:39
  • Thanks! The `n` flag was key, although it is very subtle. I was just trying to get the process number. – modulitos May 20 '15 at 10:33

1 Answers1

2

You can use lsof with the -i option. IE: lsof -i:80 for view what's listening on port 80.

Also you can use ss -tlpn to view all processes listening for ports.

Regards

bekce
  • 153
  • 1
  • 5
mvillar
  • 428
  • 6
  • 19