Jump to content

Display a List of Open Network Connections on the Mac OS X Desktop


Recommended Posts

Posted

<div class="KonaBody"><p><img src="http://osxdaily.com/wp-content/uploads/2011/07/display-open-network-connections-mac-desktop.jpg" alt="Display open network connections on Mac OS X desktop" title="display-open-network-connections-mac-desktop" width="617" height="235" class="aligncenter size-full wp-image-18514" /></p>

<p>Using GeekTool and lsof, you can display an automatically updated list of open network connections directly on a Mac OS X desktop. This is tip is a “safe” alternative to the <a href="http://osxdaily.com/2011/07/09/watch-all-open-network-connections-in-mac-os-x-with-open_ports/">previously mentioned open_ports utility</a>.</p>

<p>The problem with installing and using open_ports is that it is a third party script running as root, and for many users that is unacceptable. Here is a method that is native to Mac OS X and doesn’t even require root access to watch network connections:</p>

<p>First, if you want to discard the GeekTool portion and just get a quick look at open connections, you can quickly list all open network connections with:

<code>lsof -i | grep -E "(LISTEN|ESTABLISHED)" </code></p>

<p>You could also combine this with the <a href="http://osxdaily.com/2010/08/22/install-watch-command-on-os-x/">‘watch’ utility</a> and just keep an eye on open connections in a terminal window.</p>

<p>That portion of the tip has been <a href="http://osxdaily.com/2009/09/29/list-all-open-internet-connections-on-a-mac-to-track-down-bandwidth-issues/">covered here before regarding lsof</a>, but the next part is geared specifically for GeekTool because it allows a constantly refreshed list of active connections to overlay against your desktop background picture.

<span id="more-18513"></span></p>

<h2 style="font-size:1.2em;">Displaying a Active Network Connections on the Mac OS X Desktop</h2>

<p>In order to do this, you’ll need to install GeekTool, <a href="http://projects.tynsoe.org/en/geektool/download.php">it’s a free download</a> and is a great addition to any advanced Mac users toolkit.</p>

<p>Assuming you have now downloaded and installed GeekTool, it will appear in your System Preferences. Here is the setup procedure now:</p>

<ul>

<li>Click on “Shell” and drag it to the desktop, resize it to a reasonable area</li>

<li>Using the Properties editor, name the newly dragged Shell to something like “Show Connections”</li>

<li>Under “Command” paste the following:</li>

<p><code>lsof -i | grep -E "(LISTEN|ESTABLISHED)" | awk '{print $1, $8, $9}'</code></p>

<li>Set your refresh rate to something reasonable, I chose 3 seconds but you can do whatever you want</li>

<p><img src="http://osxdaily.com/wp-content/uploads/2011/07/display-open-connections-geektool-setup.jpg" alt="geektool setup for listing open network connections" title="display-open-connections-geektool-setup" width="276" height="280" class="aligncenter size-full wp-image-18520" /></p>

<li>Adjust the font, font color, and font size in accordance to your desktop wallpaper</li>

</ul>

<p>You will immediately see a printed list of active network connections on your Mac desktop that automatically updates itself, just like the screen shot at the top of this article. No third party scripts or root access required. The GeekTool script comes from the comments on the <a href="http://hints.macworld.com/comment.php?mode=view&cid=124847">MacWorld</a> article about open_ports that they didn’t test. Very nice!</p>

</div>

<p><a href="http://feedads.g.doubleclick.net/~a/X1NANCo8wS7qdxBJhn7mk6Ts2Lk/0/da"><img src="http://feedads.g.doubleclick.net/~a/X1NANCo8wS7qdxBJhn7mk6Ts2Lk/0/di" border="0" ismap="true"></img></a><br/>

<a href="http://feedads.g.doubleclick.net/~a/X1NANCo8wS7qdxBJhn7mk6Ts2Lk/1/da"><img src="http://feedads.g.doubleclick.net/~a/X1NANCo8wS7qdxBJhn7mk6Ts2Lk/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">

<a href="http://feeds.feedburner.com/~ff/osxdaily?a=MIyDD1E7Fk0:8yvQ26029Do:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/osxdaily?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/osxdaily?a=MIyDD1E7Fk0:8yvQ26029Do:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/osxdaily?i=MIyDD1E7Fk0:8yvQ26029Do:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/osxdaily?a=MIyDD1E7Fk0:8yvQ26029Do:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/osxdaily?i=MIyDD1E7Fk0:8yvQ26029Do:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/osxdaily?a=MIyDD1E7Fk0:8yvQ26029Do:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/osxdaily?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/osxdaily?a=MIyDD1E7Fk0:8yvQ26029Do:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/osxdaily?d=qj6IDK7rITs" border="0"></img></a>

</div><img src="http://feeds.feedburner.com/~r/osxdaily/~4/MIyDD1E7Fk0" height="1" width="1"/>

 

View the full article

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic


×
×
  • Create New...