Skip to main content
Share Your Experience: Take the 2024 Developer Survey
130 votes

Is there any harm of leaving Ethernet outlet unplugged?

First: you are safe. I'm assuming you have the standard plug that looks like this: but if it is a wire that plugs into a laptop or desktop computer, the chances are good that it is a standard RJ45 ...
Slartibartfast's user avatar
68 votes

Do web browsers use different outgoing ports for different tabs?

Each connection to a website uses a different socket with default destination TCP port 80 for plain HTTP and 443 for HTTPS. For the socket to be unique, the combination of the source IP address, ...
Egon Olieux's user avatar
67 votes

What port does 'ping' work on?

Ping uses the ICMP protocol which doesn't have ports like the TCP and UDP protocols. If you need to see if Ping is disabled on a Linux system, you can check: cat /proc/sys/net/ipv4/...
Josh Zhang's user avatar
  • 846
64 votes
Accepted

Do web browsers use different outgoing ports for different tabs?

Do browsers use different ports to connect to different websites? Yes, they do. Here is an example, showing my current Firefox connections (I have 9 open tabs) on Windows 7: Notes: You can see ...
DavidPostill's user avatar
  • 158k
55 votes

Is there any harm of leaving Ethernet outlet unplugged?

The question I'd be asking is whether your ethernet is safe from your kitchen? You wouldn't want to splash liquid into the port and cause corrosion of the socket, as then devices plugged in there in ...
Sir Adelaide's user avatar
  • 4,967
49 votes
Accepted

How are source ports determined and how can I force it to use a specific port

How are local ports determined The port number is chosen by the TCP implementation software from a range of port numbers called Ephemeral Ports. The exact mechanism for choosing the port number and ...
DavidPostill's user avatar
  • 158k
43 votes

What port does 'ping' work on?

TCP/IP uses a four-layer network stack. The Link layer deals with the physical media and how to get bytes across, the Internet layer deals with IP addresses and how to route data from one node to ...
phyrfox's user avatar
  • 3,053
41 votes
Accepted

How to detect if a network is blocking outgoing ports?

tl;dr Run this command to test a specific port (fast). time nmap -p 22 portquiz.net Run this command to test popular ports (slow). time nmap portquiz.net Run this command to test all ports (...
Michael Altfield's user avatar
36 votes
Accepted

What is the difference and relationship between a process id and a port number?

To answer the question directly: there is no connection between the process ID and the port number. They enumerate entirely different things. The PID identifies a process (eg a Firefox session: each ...
Andrew Leach's user avatar
34 votes

SSH: Troubleshooting "Remote port forwarding failed for listen port" errors

Why does ssh -N -R 2222:localhost:22 <bluehost_user>@<bluehost_ip> result in a "Remote port forwarding failed for listen port" error? I get this exact warning when I attempt to use a port ...
Kamil Maciorowski's user avatar
32 votes

Are there good alternative HTTP ports rather than port 80?

There are actually 3 HTTP alternative ports: 591, 8008 and 8080. They are assigned by IANA as "HTTP Alternate", which makes them pretty much as official as it gets. If you run Linux as a non-...
Calimo's user avatar
  • 1,425
32 votes

Why are USB ports sometimes referred to as serial ports and called COM?

These aren't USB ports referred to as serial ports. In your example, the Arduino has a USB-to-serial device (either in the form of a second microcontroller, or an FTDI chip). This will use USB to ...
Joren Vaes's user avatar
24 votes

How to kill a process by port on MacOS, a la fuser -k 9000/tcp

Adding the -t and -i flags to lsof should speed it up even more by removing the need for grep and awk. lsof -nti:NumberOfPort | xargs kill -9 lsof arguments: -n Avoids host names lookup (may result ...
Zlemini 's user avatar
22 votes

Why are USB ports sometimes referred to as serial ports and called COM?

It's confusing because Windows COM: ports come from a naming system defined back in MS-DOS (b. 1980). This was pretty-much copied from CP/M (b. 1974) with some ideas taken from Unix. They didn't ...
TonyM's user avatar
  • 353
20 votes

Test if a port on a remote system is reachable (without telnet)

Here is one-liner: </dev/tcp/localhost/11211 && echo Port is open || echo Port is closed using Bash syntax explained in @lornix answer. For more info, check: Advanced Bash-Scripting ...
kenorb's user avatar
  • 25.6k
18 votes
Accepted

Multiple processes listening on the same port; how is it possible?

It is possible. The goal is to process multiple incoming connections in parallel. Multiple haproxy instances may utilize separate CPU cores and work (semi-)independently. An incoming connection will ...
Kamil Maciorowski's user avatar
15 votes

Manually closing a port from commandline

You can close a listening socket using ss: sudo ss --kill state listening src :1234 Where 1234 is your port number. ss is part of the iproute2 package, so there is a strong change it is already ...
Tom Anderson's user avatar
  • 1,773
14 votes

Test if a port on a remote system is reachable (without telnet)

Combining the answers from @kenorb and @Azukikuru you could test port open/closed/firewalled. timeout 1 bash -c '</dev/tcp/127.0.0.1/22 && echo Port is open || echo Port is closed' || echo ...
Miguel Ferreira's user avatar
14 votes
Accepted

Why does USB 3.1 only use two of the four available data lines?

USB 3.1 Gen 2 (SuperSpeed+, 10 Gbps) was designed to work over both existing USB 3.0 cables (the ones with the 5 extra contacts), as well as USB Type C cables. Since existing USB 3.0 cables (the ...
Spiff's user avatar
  • 105k
13 votes

Understanding unique ip and port

A TCP connection is uniquely identified by (Local Host, Local Port, Remote Host, Remote Port). (Technically the protocol is also part of the criteria, but if we restrict ourselves to TCP, it’s of ...
Daniel B's user avatar
  • 63.5k
12 votes

What is the difference and relationship between a process id and a port number?

The PID is shown only so that you can identify the specific process doing the communication and is unrelated to the port number. If you had multiple copies of one program running and they were all ...
Mokubai's user avatar
  • 93.1k
11 votes

Finding the process that is using a certain port in Linux

I am using "CentOS 7 minimal" which has nor netstat neither lsof. But a lot of linux distributions have the socket statistics command (i.e. ss). Here is an example of execution: # ss -tanp | grep ...
Oleksandr's user avatar
  • 211
11 votes

Test if a port on a remote system is reachable (without telnet)

I was struggling for a whole day because none of these answers seemed to work for me. The problem is that the most recent version of nc no longer has the -z flag, whereas direct access via TCP (as ...
Azukikuru's user avatar
  • 111
11 votes

Do web browsers use different outgoing ports for different tabs?

As regards tabs to different websites, there is nothing in TCP that requires the local port to be different, as long as the tuple {local IP, local port, target IP, target port} is unique. For tabs to ...
user207421's user avatar
10 votes

How are source ports determined and how can I force it to use a specific port

David Postill's answer is perfectly right. I would like just to add to it, by stressing that changing the ephemeral port range in Linux is so simple, that the OP has an affirmative answer. You ...
MariusMatutiae's user avatar
10 votes

SSH: Troubleshooting "Remote port forwarding failed for listen port" errors

Make sure there is no hanging connection on port 2222 at bluehost. Test at bluehost lsof -t -i:2222 whether any process id is using port 2222. Additionally, kill this process (for example with kill $(...
jervtub's user avatar
  • 101
10 votes
Accepted

Is there a default port that is requested by web browsers?

If I request http://localhost do browsers try a specific port? There are three well known ports commonly used by web servers: Port 80: for HTTP. Port 8080 is often used as an alternative to port 80, ...
DavidPostill's user avatar
  • 158k
10 votes

What is the difference and relationship between a process id and a port number?

Process What is a process? A process is basically a copy of a program. So, if you run a program like Notepad multiple times, each specific time will get its own Process. A process uses resources, ...
TOOGAM's user avatar
  • 15.9k
10 votes

Is there any harm of leaving Ethernet outlet unplugged?

Completely safe. You can even touch the contacts. Also, even if there is a PoE (Power over Ethernet) injector or supply on the other end, I believe that power is not sent over the wire unless a ...
Rich M's user avatar
  • 380
9 votes

Linux command get unused port

Ruby 2.x (one-liner): ruby -e 'require "socket"; puts Addrinfo.tcp("", 0).bind {|s| s.local_address.ip_port }' On my machine right now that printed: 42644 A subsequent invocation printed: 36168 ...
G. Sylvie Davies's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible