<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Better than netstat: lsof tells us who is listening to what</title>
	<atom:link href="http://billauer.se/blog/2018/12/netstat-vs-lsof/feed/" rel="self" type="application/rss+xml" />
	<link>https://billauer.se/blog/2018/12/netstat-vs-lsof/</link>
	<description>Anything I found worthy to write down.</description>
	<lastBuildDate>Thu, 26 Mar 2026 13:15:15 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.2</generator>
	<item>
		<title>By: eli</title>
		<link>https://billauer.se/blog/2018/12/netstat-vs-lsof/comment-page-1/#comment-1404</link>
		<dc:creator>eli</dc:creator>
		<pubDate>Thu, 31 Jan 2019 09:07:34 +0000</pubDate>
		<guid isPermaLink="false">https://billauer.se/blog/?p=5612#comment-1404</guid>
		<description>Thanks, that&#039;s really cute. I&#039;d consider changing the title of this post, but nah.

I&#039;ll just add that you need to be root to see the listening processes that don&#039;t belong to yourself, even with netstat -ap.</description>
		<content:encoded><![CDATA[<p>Thanks, that&#8217;s really cute. I&#8217;d consider changing the title of this post, but nah.</p>
<p>I&#8217;ll just add that you need to be root to see the listening processes that don&#8217;t belong to yourself, even with netstat -ap.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rami Rosen</title>
		<link>https://billauer.se/blog/2018/12/netstat-vs-lsof/comment-page-1/#comment-1403</link>
		<dc:creator>Rami Rosen</dc:creator>
		<pubDate>Thu, 31 Jan 2019 09:01:26 +0000</pubDate>
		<guid isPermaLink="false">https://billauer.se/blog/?p=5612#comment-1403</guid>
		<description>Hi Elli,

&gt;OK, so we have netstat to tell us which ports are &gt;opened for listening:

&gt;$ netstat -n -a &#124; grep &quot;LISTEN &quot;

&gt;Thanks, that nice, but what process is listening to &gt;these ports? 

Actually you can get the process also with netstat using the -p flag 

For example,

netstat -n -ap &#124; grep &quot;LISTEN &quot;

tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      830/sshd            
tcp        0      0 127.0.0.1:631           0.0.0.0:*               LISTEN      831/cupsd           
tcp6       0      0 127.0.0.1:36391         :::*                    LISTEN      4064/java           
tcp6       0      0 :::22                   :::*                    LISTEN      830/sshd            
tcp6       0      0 ::1:631                 :::*                    LISTEN      831/cupsd           

See man netstat:
...
...
  -p, --program
       Show the PID and name of the program to which each socket belongs.
...

Regards,
Rami Rosen</description>
		<content:encoded><![CDATA[<p>Hi Elli,</p>
<p>&gt;OK, so we have netstat to tell us which ports are &gt;opened for listening:</p>
<p>&gt;$ netstat -n -a | grep &#8220;LISTEN &#8221;</p>
<p>&gt;Thanks, that nice, but what process is listening to &gt;these ports? </p>
<p>Actually you can get the process also with netstat using the -p flag </p>
<p>For example,</p>
<p>netstat -n -ap | grep &#8220;LISTEN &#8221;</p>
<p>tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      830/sshd<br />
tcp        0      0 127.0.0.1:631           0.0.0.0:*               LISTEN      831/cupsd<br />
tcp6       0      0 127.0.0.1:36391         :::*                    LISTEN      4064/java<br />
tcp6       0      0 :::22                   :::*                    LISTEN      830/sshd<br />
tcp6       0      0 ::1:631                 :::*                    LISTEN      831/cupsd           </p>
<p>See man netstat:<br />
&#8230;<br />
&#8230;<br />
  -p, &#8211;program<br />
       Show the PID and name of the program to which each socket belongs.<br />
&#8230;</p>
<p>Regards,<br />
Rami Rosen</p>
]]></content:encoded>
	</item>
</channel>
</rss>
