how to list all the processes that hold the ports and it's pid

Posted on 2007-08-05
Last Modified: 2010-04-20
hi all,
#nmap -sT localhost
lists all the open ports and it's associated service/process
how can I make it display
all open ports and it's associated service/process and the service/process pid
thanks in advance
best regards
Question by:shang3000
    LVL 19

    Accepted Solution

    How about netstat -aptu

    a - listening
    p - process
    t - tcp
    u - udp

    you can also add n to stop it trying to resolve hostnames (quicker).
    LVL 19

    Expert Comment

    Correction, that should be l for listening, not a, so
    netstat -lpntu
    LVL 27

    Expert Comment

    by:Jason Watkins

    ps -ax will show all running processes & what not.


    Featured Post

    6 Surprising Benefits of Threat Intelligence

    All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

    Join & Write a Comment

    Daily system administration tasks often require administrators to connect remote systems. But allowing these remote systems to accept passwords makes these systems vulnerable to the risk of brute-force password guessing attacks. Furthermore there ar…
    This is the error message I got (CODE) Error caused by incompatible libmp3lame 3.98-2 with ffmpeg I've googled this error message and found out sometimes it attaches this note "can be treated with downgrade libmp3lame to version 3.97 or 3.98" …
    Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
    Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…

    729 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

    17 Experts available now in Live!

    Get 1:1 Help Now