Linux tips
Linux Tip of the Day
November 13, 2014

Hi all,

I’d like to share this with all of you. Because of my job I had the necessity to know which port where used on a remote server that hadn’t nmap installed on it, so what I did was:

sudo lsof -nP -i | grep LISTEN

Here is the explanation:

lsof – list of open files

-nP the n option inhibits the conversion of network numbers to host names to run faster, while the P option inhibits the conversion of port numbers to port names for network files. Piping the result with grep LISTEN you get a list of all the active ports


Leave a Reply

By continuing to use the site, you agree to the use of cookies. more information

The cookie settings on this website are set to "allow cookies" to give you the best browsing experience possible. If you continue to use this website without changing your cookie settings or you click "Accept" below then you are consenting to this.