I want to run this command in Ubuntu:

tcp 0 0* LISTEN <pid>/java

but tcp is not recognized in Ubuntu. What could be an alternative for this?

  • 1
    Why do you want to run that command? As noted above, this is output from another command, and includes java as the only executable part of it. Are you wanting to write a java program that listens on port 50010? Please spell out your situation. – Jeff Schaller Apr 29 '18 at 13:43

I think you can find solution using this guide.

Use netstat command

  1. Listing all the LISTENING Ports of TCP and UDP connections

    Listing all ports (both TCP and UDP) using netstat -a option.

  2. Listing TCP Ports connections

    Listing only TCP (Transmission Control Protocol) port connections using netstat -at.


20 Netstat Commands for Linux Network Management

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