Giovanni
Giovanni

Reputation: 153

How can i know who is using a port?

When I browse "localhost:8080" it ask me to authenticate, but I do not know which program on Windows is using that port.

How can I determine which program is using that port?

Upvotes: 12

Views: 32773

Answers (2)

David Silveiro
David Silveiro

Reputation: 1602

You could use the following two methods, depending on your OS :)

Windows

  • Open the command prompt - start » run » cmd or start » All Programs » Accessories » Command Prompt.

  • Type netstat -aon | findstr '[8080]'

  • If the port is being used by any application, then that application’s detail will be shown. The number, which is shown at the last column of the list, is the PID (process ID) of that application. Make note of this.

  • Type tasklist | findstr '[PID]'. Replace the [PID] with the number from the above step and hit enter.

  • You will then be shown the application name that is using your port number


Linux (Debian/Ubuntu)

  • open the terminal and enter sudo apt install net-tools

  • open the terminal and enter netstat -ltnp | grep -w ':8080'

  • You should then see the application using said port on the far right of the terminal [PID]/SomeApplicationName

Upvotes: 14

Justin
Justin

Reputation: 134

https://www.tecmint.com/10-lsof-command-examples-in-linux/

lsof: is the command you need

Upvotes: 0

Related Questions