Check what is using a port on linux
April 24th, 2023 8:24 AM Mr. Q Categories: Linux
Assume we are looking for port 443. Use the “netstat” command on Linux to see which processes are using port 443. Here’s how to do it:
- Open a terminal window on your Linux machine.
- Run the following command to display all network connections and listening ports:
sudo netstat -tulpn | grep 443
This will show a list of all active network connections and the corresponding processes that are using them.
- Look for the line that shows “443” in the “Local Address” column. This indicates that a process is using port 443.
- Check the corresponding process ID (PID) in the “PID/Program name” column.
- Run the following command to get more information about the process using the PID:
sudo ps -ef | grep <PID>
Replace “<PID>” with the actual PID you found in step 4.
This command will show you the name and other details of the process that is using port 443.
Once you know which process is using port 443, you can decide whether to stop or reconfigure the process, or to use a different port for your own purposes.