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?

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

1 Answer 1

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.