Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want to know which is the port used by my system on accessing a particular URL. Suppose the URL is ip_address:9081/abc Is the software port 9081 of my system is being used to access the URL? How can I identify it? Is there any command to identify the used port for a particular URL?

share|improve this question

migrated from Jan 15 '13 at 9:18

This question came from our site for professional and enthusiast programmers.

No, your system port is choosen randomly (from pool of free ports usually); it can be altered by routers, firewalls etc. Other system port is 9081, they are absolutely independent. – Arvo Jan 15 '13 at 8:10
By "port" do you mean the local source port for the TCP connection? If so, Arvo's comment is correct. The TCP/IP stack chooses one randomly. (The application can bind to a specific port if it wishes to, but generally there's no reason to do so.) – David Schwartz Jan 15 '13 at 8:11

No, 8081 is the port you are connecting to (in the server). To know the local port of the connection (wich usually is random in high values of the port range) exec netstat command when you have a connection stablished (works in windows, and unix-like systems.)

share|improve this answer

You must log in to answer this question.