• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 145
  • Last Modified:

How do I tell if a port is being used or not

How do I tell if port 7778 is currently being used ?

Thanks
0
Anthony Lucia
Asked:
Anthony Lucia
3 Solutions
 
Seth SimmonsSr. Systems AdministratorCommented:
do this as root

netstat -at | grep 7778

it will show if the port is open
0
 
woolmilkporcCommented:
You should add the "-n" flag to see the port number instead of its name, otherwise "grep 7778" won't find the port in question.
Additionally add the "-p" flag to see which process is holding the port open (if any).
Add "-u" to see UDP ports along with TCP ports ("-p").
Add a ":" in front of the number so you won't find e.g. a PID instead of a port number.

netstat -atnpu | grep ":7778"
0
 
joolsCommented:
also, `lsof | grep 7778`
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now