<?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"
	>
<channel>
	<title>Comments on: netstat to find ports which are in use on linux server</title>
	<atom:link href="http://midnight-cafe.co.uk/linux-commands/netstat-to-find-ports-which-are-in-use/feed/" rel="self" type="application/rss+xml" />
	<link>http://midnight-cafe.co.uk/linux-commands/netstat-to-find-ports-which-are-in-use/</link>
	<description></description>
	<pubDate>Wed, 08 Sep 2010 14:11:03 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6.2</generator>
		<item>
		<title>By: Anil Dewani</title>
		<link>http://midnight-cafe.co.uk/linux-commands/netstat-to-find-ports-which-are-in-use/#comment-6537</link>
		<dc:creator>Anil Dewani</dc:creator>
		<pubDate>Thu, 06 May 2010 10:25:59 +0000</pubDate>
		<guid isPermaLink="false">http://midnight-cafe.co.uk/?p=6#comment-6537</guid>
		<description>This helped me in one of my projects. You rock!</description>
		<content:encoded><![CDATA[<p>This helped me in one of my projects. You rock!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: iyiadam</title>
		<link>http://midnight-cafe.co.uk/linux-commands/netstat-to-find-ports-which-are-in-use/#comment-119</link>
		<dc:creator>iyiadam</dc:creator>
		<pubDate>Mon, 17 Nov 2008 11:56:37 +0000</pubDate>
		<guid isPermaLink="false">http://midnight-cafe.co.uk/?p=6#comment-119</guid>
		<description>Thanks for the great tips.</description>
		<content:encoded><![CDATA[<p>Thanks for the great tips.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: seo</title>
		<link>http://midnight-cafe.co.uk/linux-commands/netstat-to-find-ports-which-are-in-use/#comment-57</link>
		<dc:creator>seo</dc:creator>
		<pubDate>Wed, 12 Nov 2008 17:58:49 +0000</pubDate>
		<guid isPermaLink="false">http://midnight-cafe.co.uk/?p=6#comment-57</guid>
		<description>Thats an interesting article - your blog is really good i keep coming back here all the time keep it up!</description>
		<content:encoded><![CDATA[<p>Thats an interesting article - your blog is really good i keep coming back here all the time keep it up!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jay smith</title>
		<link>http://midnight-cafe.co.uk/linux-commands/netstat-to-find-ports-which-are-in-use/#comment-52</link>
		<dc:creator>jay smith</dc:creator>
		<pubDate>Tue, 11 Nov 2008 11:23:13 +0000</pubDate>
		<guid isPermaLink="false">http://midnight-cafe.co.uk/?p=6#comment-52</guid>
		<description>Thanks for the great tips.</description>
		<content:encoded><![CDATA[<p>Thanks for the great tips.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: davidavila</title>
		<link>http://midnight-cafe.co.uk/linux-commands/netstat-to-find-ports-which-are-in-use/#comment-42</link>
		<dc:creator>davidavila</dc:creator>
		<pubDate>Sat, 01 Nov 2008 11:17:19 +0000</pubDate>
		<guid isPermaLink="false">http://midnight-cafe.co.uk/?p=6#comment-42</guid>
		<description>Keep up the good work! :)</description>
		<content:encoded><![CDATA[<p>Keep up the good work! <img src='http://midnight-cafe.co.uk/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Vince4u2</title>
		<link>http://midnight-cafe.co.uk/linux-commands/netstat-to-find-ports-which-are-in-use/#comment-41</link>
		<dc:creator>Vince4u2</dc:creator>
		<pubDate>Sat, 01 Nov 2008 07:52:39 +0000</pubDate>
		<guid isPermaLink="false">http://midnight-cafe.co.uk/?p=6#comment-41</guid>
		<description>I recently discovered this blog. I've had a similiar idea to your rewriting the ten commandments for some time now.</description>
		<content:encoded><![CDATA[<p>I recently discovered this blog. I&#8217;ve had a similiar idea to your rewriting the ten commandments for some time now.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Angelo</title>
		<link>http://midnight-cafe.co.uk/linux-commands/netstat-to-find-ports-which-are-in-use/#comment-13</link>
		<dc:creator>Angelo</dc:creator>
		<pubDate>Tue, 07 Oct 2008 19:21:29 +0000</pubDate>
		<guid isPermaLink="false">http://midnight-cafe.co.uk/?p=6#comment-13</guid>
		<description>Hello,

Command netstat -na &#124; awk ‘$1==”tcp” &#124;&#124; $1==”udp” {print $4}’ &#124; cut -d: -f2 &#124; uniq -c &#124; sort -k 1,1n -k 2,2n show all ports but it is every complicated to understand and recall
command given in post is simple to understand also single quotes issue is corrected in post so you can copy command from blog and run in shell.</description>
		<content:encoded><![CDATA[<p>Hello,</p>
<p>Command netstat -na | awk ‘$1==”tcp” || $1==”udp” {print $4}’ | cut -d: -f2 | uniq -c | sort -k 1,1n -k 2,2n show all ports but it is every complicated to understand and recall<br />
command given in post is simple to understand also single quotes issue is corrected in post so you can copy command from blog and run in shell.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: scribe63</title>
		<link>http://midnight-cafe.co.uk/linux-commands/netstat-to-find-ports-which-are-in-use/#comment-12</link>
		<dc:creator>scribe63</dc:creator>
		<pubDate>Tue, 07 Oct 2008 17:34:07 +0000</pubDate>
		<guid isPermaLink="false">http://midnight-cafe.co.uk/?p=6#comment-12</guid>
		<description>WOW what a difference. Ok i stand corrected.

Lesson learned, do not copy command from blog and run in shell or maybe even paste in text editor. 

LOL

Thanks very much for the pointer abcuser and brining it to my attention, did not notice that subtle difference at all. I did change the quote characters and the commands do work.

netstat -na &#124; awk '$1=="tcp" &#124;&#124; $1=="udp" {print $4}' &#124; cut -d: -f2 &#124; uniq -c &#124; sort -k 1,1n -k 2,2n

      1 111
      1 111
      1 631
      1 631
      1 868
      1 892
      1 895
      1 898
      1 5353
      1 5433
      1 32770
      1 32771
      1 44774


I guess it a writers blog as oppose to a scripting language blog, if there is such a thing

Thanks again abcuser

PEACE</description>
		<content:encoded><![CDATA[<p>WOW what a difference. Ok i stand corrected.</p>
<p>Lesson learned, do not copy command from blog and run in shell or maybe even paste in text editor. </p>
<p>LOL</p>
<p>Thanks very much for the pointer abcuser and brining it to my attention, did not notice that subtle difference at all. I did change the quote characters and the commands do work.</p>
<p>netstat -na | awk &#8216;$1==&#8221;tcp&#8221; || $1==&#8221;udp&#8221; {print $4}&#8217; | cut -d: -f2 | uniq -c | sort -k 1,1n -k 2,2n</p>
<p>      1 111<br />
      1 111<br />
      1 631<br />
      1 631<br />
      1 868<br />
      1 892<br />
      1 895<br />
      1 898<br />
      1 5353<br />
      1 5433<br />
      1 32770<br />
      1 32771<br />
      1 44774</p>
<p>I guess it a writers blog as oppose to a scripting language blog, if there is such a thing</p>
<p>Thanks again abcuser</p>
<p>PEACE</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: abcuser</title>
		<link>http://midnight-cafe.co.uk/linux-commands/netstat-to-find-ports-which-are-in-use/#comment-11</link>
		<dc:creator>abcuser</dc:creator>
		<pubDate>Tue, 07 Oct 2008 12:11:28 +0000</pubDate>
		<guid isPermaLink="false">http://midnight-cafe.co.uk/?p=6#comment-11</guid>
		<description>scribe63,
the problem is commands are correct but blog doesn't put correct characters.

So character ‘ or ’  is single quote and character ” is double quote. Replace this two characters with correct one from keyboard.

[code]netstat -na &#124; awk '$1=="tcp" &#124;&#124; $1=="udp" {print $4}' &#124; cut -d: -f2 &#124; uniq -c &#124; sort -k 1,1n -k 2,2n[/code]</description>
		<content:encoded><![CDATA[<p>scribe63,<br />
the problem is commands are correct but blog doesn&#8217;t put correct characters.</p>
<p>So character ‘ or ’  is single quote and character ” is double quote. Replace this two characters with correct one from keyboard.</p>
<p>[code]netstat -na | awk &#8216;$1==&#8221;tcp&#8221; || $1==&#8221;udp&#8221; {print $4}&#8217; | cut -d: -f2 | uniq -c | sort -k 1,1n -k 2,2n[/code]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: scribe63</title>
		<link>http://midnight-cafe.co.uk/linux-commands/netstat-to-find-ports-which-are-in-use/#comment-9</link>
		<dc:creator>scribe63</dc:creator>
		<pubDate>Mon, 06 Oct 2008 16:47:39 +0000</pubDate>
		<guid isPermaLink="false">http://midnight-cafe.co.uk/?p=6#comment-9</guid>
		<description>I am no script master, but always willing to learn, when it is useful to me.
To me this was a futile and i guess a way of learning to use awk.

The authors example, and most of the responders corrections, threw errors.

Author example
netstat -nap &#124; grep ‘tcp\&#124;udp’ &#124; awk ‘{print $4}’ &#124; cut -d: -f2 &#124; sort &#124; uniq -c &#124; awk ‘{print $2}’

awk: ‘{print
awk: ^ invalid char '?' in expression
awk: ‘{print
awk: ^ invalid char '?' in expression
(Not all processes could be identified, non-owned process info
 will not be shown, you would have to be root to see it all.)
warning, got bogus unix line.

Responders corrections
Jondor correction
 netstat -nap &#124; grep ‘tcp\&#124;udp’ &#124; awk ‘{print $4}’ &#124; cut -d: -f2 &#124; sort &#124; uniq -c &#124; sort -n
awk: ‘{print
awk: ^ invalid char '?' in expression
(Not all processes could be identified, non-owned process info
 will not be shown, you would have to be root to see it all.)
warning, got bogus unix line.

 abcuser correction

 netstat -na &#124; awk ‘$1==”tcp” &#124;&#124; $1==”udp” {print $4}’ &#124; cut -d: -f2 &#124; uniq -c &#124; sort -k 1,1n -k 2,2n

awk: ‘==”tcp”
awk: ^ invalid char '?' in expression
warning, got bogus unix line.
bash: ==”udp”: command not found


This is the only one that worked.
netstat -putwlan

I guess it is a learning process when it is all said and done. But bogus commands make reading these type of blogs untrustworthy, and i wonder if they were tested before being posted.

PEACE</description>
		<content:encoded><![CDATA[<p>I am no script master, but always willing to learn, when it is useful to me.<br />
To me this was a futile and i guess a way of learning to use awk.</p>
<p>The authors example, and most of the responders corrections, threw errors.</p>
<p>Author example<br />
netstat -nap | grep ‘tcp\|udp’ | awk ‘{print $4}’ | cut -d: -f2 | sort | uniq -c | awk ‘{print $2}’</p>
<p>awk: ‘{print<br />
awk: ^ invalid char &#8216;?&#8217; in expression<br />
awk: ‘{print<br />
awk: ^ invalid char &#8216;?&#8217; in expression<br />
(Not all processes could be identified, non-owned process info<br />
 will not be shown, you would have to be root to see it all.)<br />
warning, got bogus unix line.</p>
<p>Responders corrections<br />
Jondor correction<br />
 netstat -nap | grep ‘tcp\|udp’ | awk ‘{print $4}’ | cut -d: -f2 | sort | uniq -c | sort -n<br />
awk: ‘{print<br />
awk: ^ invalid char &#8216;?&#8217; in expression<br />
(Not all processes could be identified, non-owned process info<br />
 will not be shown, you would have to be root to see it all.)<br />
warning, got bogus unix line.</p>
<p> abcuser correction</p>
<p> netstat -na | awk ‘$1==”tcp” || $1==”udp” {print $4}’ | cut -d: -f2 | uniq -c | sort -k 1,1n -k 2,2n</p>
<p>awk: ‘==”tcp”<br />
awk: ^ invalid char &#8216;?&#8217; in expression<br />
warning, got bogus unix line.<br />
bash: ==”udp”: command not found</p>
<p>This is the only one that worked.<br />
netstat -putwlan</p>
<p>I guess it is a learning process when it is all said and done. But bogus commands make reading these type of blogs untrustworthy, and i wonder if they were tested before being posted.</p>
<p>PEACE</p>
]]></content:encoded>
	</item>
</channel>
</rss>
<!-- phpmyvisites -->
<a href="http://www.phpmyvisites.net/" title="Free web analytics, website statistics"
onclick="window.open(this.href);return(false);"><script type="text/javascript">
<!--
var a_vars = Array();
var pagename='';

var phpmyvisitesSite = 1;
var phpmyvisitesURL = "http://midnight-cafe.co.uk/phpmv2/phpmyvisites.php";
//-->
</script>
<script language="javascript" src="http://midnight-cafe.co.uk/phpmv2/phpmyvisites.js" 

type="text/javascript"></script>
<object><noscript><p>Free web analytics, website statistics
<img src="http://midnight-cafe.co.uk/phpmv2/phpmyvisites.php" alt="Statistics" 

style="border:0" />
</p></noscript></object></a>
<!-- /phpmyvisites --> 
