This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to check if a particular port assigned is listening

 
san ch
Ranch Hand
Posts: 68
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

iam working in solaris and configured my messaging server to port 82 ,i want to know how to check if this port is listening .......i tried
netstat -anp |grep 82
it jus gave me prompt again didnt understand
any help would be great
thank you in advance
san
 
Lewin Chan
Ranch Hand
Posts: 214
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are you running your messaging server as root, attempts to listen on a port < 1024 on Unix like systems is restricted to root only.

On solaris, I would probably check all the listening processes using


as netstat doesn't work in quite the same way as on Linux.

You'll get output like


So you know there's something listening on port 80, 5987, 38669 (etc etc).
 
Ulf Dittmer
Rancher
Pie
Posts: 42966
73
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try to telnet into port 82. If the connection is refused, there's nothing listening on that port.
 
Tim Holloway
Saloon Keeper
Pie
Posts: 17624
39
Android Eclipse IDE Linux
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
On Linux grepping for the port number can fail if the port has an entry in /etc/services, such as "http". Thus you want to either search by service name or force numeric port display.

I believe that "netstat -ln" will do it for you.
 
Stefan Wagner
Ranch Hand
Posts: 1923
Linux Postgres Database Scala
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm used to use

to check ports, and (as root)
 
san ch
Ranch Hand
Posts: 68
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

Thank you for your response,iam working as root ,i will try these things.
i ahve tried
and iam getting the prompt normally ,does this mean the port is listening???the telent to the port looks like a good idea will see if i can do that thank you soo much
san ch
 
Stefan Wagner
Ranch Hand
Posts: 1923
Linux Postgres Database Scala
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No, that means 'not listening'
Grep filters lines (from the output, if used in a pipe) and displays only matching lines.
A better command would be:
 
san ch
Ranch Hand
Posts: 68
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you for your help it is working

san ch
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic