Port in use on Solaris 9

Posted on 2004-10-27
Last Modified: 2013-12-21
I want to see if port 389 is listening on Solaris.  What's the best way?
Question by:lcor
    LVL 19

    Expert Comment

    you will see all established and waiting connection.
    check for lines with LISTENINg on it.
    If something is runnning on port 389 you will see it.
    LVL 38

    Assisted Solution

    netstat -a
    You need "-a" option.

    LVL 19

    Accepted Solution

    sorry it should be
    #netstat -a

    or better to see only daemons:
    #netstat -a | grep LISTEN

    In lines check that ldap or 389 doesn't exist in first column. It means that there is no daemon listening on port 389.

    LVL 48

    Assisted Solution

    Another way is to telnet to the port, eg:

    telnet localhost 389
    LVL 38

    Assisted Solution

    netstat is the tool for the job, eg: to check the occupied port being used and the
    appplication who use them, use command:

    netstat –anP tcp

    To find out the program listening
    to a paticular tcp port

    netstat -a | grep LISTEN | grep port-no

        check port 80:
        netstat -a | grep LISTEN | grep 80

    man netstat
    to learn more details.

    and see http:Q_20887412.html

    If you want to find out the process ID run on a particular port, you can use the following


    echo -n "which port?> "
    read port

    for pid in `ps -ef -o pid | tail +2`
      foundport=`pfiles $pid 2>&1 | grep "sockname:" | grep "port: $port$" |
    '{print $NF}'`
      if [ "$foundport" != "" ]; then
        foundproc=`pfiles $pid 2>&1 | grep "^$pid:"`
        echo "$foundproc, $foundport"


    # End of script

    Another good tool for the job is "lsof" you can download it from:


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Looking for New Ways to Advertise?

    Engage with tech pros in our community with native advertising, as a Vendor Expert, and more.

    A metadevice consists of one or more devices (slices). It can be expanded by adding slices. Then, it can be grown to fill a larger space while the file system is in use. However, not all UNIX file systems (UFS) can be expanded this way. The conca…
    Installing FreeBSD… FreeBSD is a darling of an operating system. The stability and usability make it a clear choice for servers and desktops (for the cunning). Savvy?  The Ports collection makes available every popular FOSS application and packag…
    Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
    In a previous video, we went over how to export a DynamoDB table into Amazon S3.  In this video, we show how to load the export from S3 into a DynamoDB table.

    846 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    8 Experts available now in Live!

    Get 1:1 Help Now