Mailinglist Archive: opensuse (1589 mails)

< Previous Next >
Re: [opensuse] Address already in use
  • From: Randall R Schulz <rschulz@xxxxxxxxx>
  • Date: Tue, 6 Oct 2009 21:51:40 -0700
  • Message-id: <200910062151.41088.rschulz@xxxxxxxxx>
On Tuesday October 6 2009, Ricky Tompu Breaky wrote:
Dear my friends...

I use OpenSuSE11.1.

How can I know which TCP port number is being occupied? And how can
I know which service is using a certain port number? All I know only
turn off the firewall and doing "nmap -PN [FQDN-hostname]".

You can use the "lsof" command to associate IP addresses and port
numbers with the running process(es) that have that address / port

To see all the IP ports in use with their process IDs (as root):

# lsof |egrep IP

Limiting it to IPv4:

# lsof |egrep IPv4

Limiting it futher to TCP:

# lsof |egrep 'IPv4.*TCP'

And so on.

The process ID is the 2nd column and the program name is the 1st. Piping
through grep like that removes the column headers, but you can see them
with this:

# lsof |head -1

I get this error (in /var/log/mail) as I want to start my postfix:
postfix/master[10597]: fatal: bind port 10025: Address
already in use

Thank you very much in advance.

Randall Schulz
To unsubscribe, e-mail: opensuse+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: opensuse+help@xxxxxxxxxxxx

< Previous Next >