<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:go='http://ns.gigaom.com/'
xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>GigaOM &#187; Apple</title>
	<atom:link href="http://gigaom.com/apple/tag/command-line/feed/" rel="self" type="application/rss+xml" />
	<link>http://gigaom.com</link>
	<description></description>
	<lastBuildDate>Sun, 27 May 2012 04:22:42 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='gigaom.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://0.gravatar.com/blavatar/0db8f6557d022075dbbf010c54d46d93?s=96&#038;d=http%3A%2F%2Fs2.wp.com%2Fi%2Fbuttonw-com.png</url>
		<title>GigaOM &#187; Apple</title>
		<link>http://gigaom.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://gigaom.com/osd.xml" title="GigaOM" />
	<atom:link rel='hub' href='http://gigaom.com/?pushpress=hub'/>
		<item>
		<title>It’s the Little Things: Command Line Improvements to Mac OS X</title>
		<link>http://gigaom.com/apple/it%e2%80%99s-the-little-things-command-line-improvements-to-mac-os-x/</link>
		<comments>http://gigaom.com/apple/it%e2%80%99s-the-little-things-command-line-improvements-to-mac-os-x/#comments</comments>
		<pubDate>Thu, 21 May 2009 21:00:55 +0000</pubDate>
		<dc:creator>Tom Reestman</dc:creator>
				<category><![CDATA[CNN Big Tech]]></category>
		<category><![CDATA[Commentary]]></category>
		<category><![CDATA[NYT Enterprise]]></category>
		<category><![CDATA[SYN Analysis]]></category>
		<category><![CDATA[command line]]></category>
		<category><![CDATA[hacks]]></category>
		<category><![CDATA[os x]]></category>
		<category><![CDATA[terminal]]></category>

		<guid isPermaLink="false">http://theappleblog.com/?p=24183</guid>
		<description><![CDATA[Recently, two articles appeared on TechRadar documenting various command line tweaks for various apps and functions of Mac OS X. While I didn’t find anything new there, it’s nice to have two articles that summarize a bunch instead of tracking them down one by one across [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=gigaom.com&#038;blog=14960843&#038;post=172775&#038;subd=gigaom2&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><img  title="Terminal" src="http://gigapple.files.wordpress.com/2009/05/terminal.png?w=133&h=118" alt="Terminal" width="133" height="118" class=" alignleft" /></p>
<p class="excerpt">Recently, <a href="http://www.techradar.com/news/computing/apple/15-terminal-commands-to-supercharge-os-x-599882?artc_pg=1">two</a> <a href="http://www.techradar.com/news/computing/apple/unlock-mac-os-x-apps-hidden-features-600153?artc_pg=1">articles</a> appeared on TechRadar documenting various command line tweaks for various apps and functions of Mac OS X. While I didn’t find anything new there, it’s nice to have two articles that summarize a bunch instead of tracking them down one by one across countless bookmarks.</p>
<p>To be honest, most command line tweaks don’t appeal to me. For example, I’d sooner go back to running DOS than go back to using Safari’s “standard” tabs; I love the tabs on top. Still, it&#8217;s nice to know I could make the change if I felt so inclined.<span id="more-172775"></span></p>
<p>What’s surprising to me is that some of the tweaks I <em>do</em> like are incredibly simple &#8212; for example, the command that turns on stack highlighting even when using the mouse (No. eight in the first article above). Obviously, having the cursor over an item tells me which one will be activated if I click, and yet I like the highlight as a further indicator.</p>
<p><img  title="Stack_Hilights" src="http://gigapple.files.wordpress.com/2009/05/stack_hilights.png?w=590&h=464" alt="Stack_Hilights" width="590" height="464" class=" alignleft" /><br />
I also like the one to remove the arrows from iTunes’ interface (No. seven in the second article). Again, this is a little thing, yet I value it in a manner that’s completely out of proportion to the actual change it makes. Put simply, I hate those arrows.</p>
<p>Meanwhile, there’s a tweak for Safari I really like that&#8217;s not in either article. It&#8217;s one that forces a click to open in a new tab (instead of a window). You can find that one <a href="http://www.macuser.com/tips/psst_safari_31_is_a_single_win.php?lsrc=murss">here</a>. Though documented for Safari 3.1, I use it for the Safari 4 beta with no issues.</p>
<p>I&#8217;m curious what you think. Which tweaks do you really like? Do you have any to add, and do they seem like major or minor changes to you?</p>
<p><strong>Related research and analysis from GigaOM Pro:</strong><br />Subscriber content. <a href="http://pro.gigaom.com/?utm_source=apple&utm_medium=editorial&utm_campaign=auto3&utm_term=172775+it%25e2%2580%2599s-the-little-things-command-line-improvements-to-mac-os-x&utm_content=thesmallwave">Sign up for a free trial</a>.</p><ul><li><a href="http://pro.gigaom.com/2011/03/why-ipad-2-will-lead-consumers-into-the-post-pc-era/?utm_source=apple&amp;utm_medium=editorial&amp;utm_campaign=waterfall?utm_source=apple&utm_medium=editorial&utm_campaign=auto3&utm_term=172775+it%25e2%2580%2599s-the-little-things-command-line-improvements-to-mac-os-x&utm_content=thesmallwave">Why iPad 2 Will Lead Consumers Into the Post-PC&nbsp;Era</a></li><li><a href="http://pro.gigaom.com/2011/03/the-near-term-evolution-of-social-commerce/?utm_source=apple&amp;utm_medium=editorial&amp;utm_campaign=waterfall?utm_source=apple&utm_medium=editorial&utm_campaign=auto3&utm_term=172775+it%25e2%2580%2599s-the-little-things-command-line-improvements-to-mac-os-x&utm_content=thesmallwave">The Near-Term Evolution of Social&nbsp;Commerce</a></li><li><a href="http://pro.gigaom.com/2011/02/content-farms-the-players-the-benefits-the-risks/?utm_source=apple&amp;utm_medium=editorial&amp;utm_campaign=waterfall?utm_source=apple&utm_medium=editorial&utm_campaign=auto3&utm_term=172775+it%25e2%2580%2599s-the-little-things-command-line-improvements-to-mac-os-x&utm_content=thesmallwave">Content Farms: The Players, The Benefits, The&nbsp;Risks</a></li></ul><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=gigaom.com&#038;blog=14960843&#038;post=172775&#038;subd=gigaom2&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://gigaom.com/apple/it%e2%80%99s-the-little-things-command-line-improvements-to-mac-os-x/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/e1c4841c01b82448b3d91f3e21241e3d?s=96&#38;d=retro&#38;r=PG" medium="image">
			<media:title type="html">Tom</media:title>
		</media:content>

		<media:content url="http://gigapple.files.wordpress.com/2009/05/terminal.png" medium="image">
			<media:title type="html">Terminal</media:title>
		</media:content>

		<media:content url="http://gigapple.files.wordpress.com/2009/05/stack_hilights.png" medium="image">
			<media:title type="html">Stack_Hilights</media:title>
		</media:content>
	</item>
		<item>
		<title>Getting A Handle On Your iPhone Data (A Mini-Tales From The Command Line Story)</title>
		<link>http://gigaom.com/apple/getting-a-handle-on-your-iphone-data-a-mini-tales-from-the-command-line-story/</link>
		<comments>http://gigaom.com/apple/getting-a-handle-on-your-iphone-data-a-mini-tales-from-the-command-line-story/#comments</comments>
		<pubDate>Wed, 20 Aug 2008 15:00:49 +0000</pubDate>
		<dc:creator>Bob Rudis</dc:creator>
				<category><![CDATA[Asides]]></category>
		<category><![CDATA[Commentary]]></category>
		<category><![CDATA[Software Reviews]]></category>
		<category><![CDATA[backup]]></category>
		<category><![CDATA[command line]]></category>
		<category><![CDATA[ecamm]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[phoneview]]></category>
		<category><![CDATA[sms]]></category>
		<category><![CDATA[sqlite]]></category>
		<category><![CDATA[unix]]></category>

		<guid isPermaLink="false">http://theappleblog.com/?p=4194</guid>
		<description><![CDATA[The past two weeks have been fairly hectic, with little time to deal with anything but security updates to software (hence, no software update news). This week, however, my iPhone needed some serious care and feeding as it was taking forever to load up the SMS [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=gigaom.com&#038;blog=14960843&#038;post=171600&#038;subd=gigaom2&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><img src="http://gigapple.files.wordpress.com/2008/08/phoneview-icon.png?w=128&h=128" alt="" title="phoneview-icon" width="128" height="128"  class=" alignleft" />The past two weeks have been fairly hectic, with little time to deal with anything but security updates to software (hence, no software update news). This week, however, my iPhone needed some serious care and feeding as it was taking forever to load up the SMS screens since I have saved most every SMS I have received since purchasing the phone last July. Despite the iPhone using <a href="http://www.sqlite.org/">SQLite</a> as the foundation information store for items such as SMS messages and Contacts, a large number of entries in these repositories seems to slow the associated user interfaces to a crawl (which is probably an app/UI issue more than it is a database issue). Rather than just clear the extended conversations, I wanted to have an accessible, readable backup of them first.</p>
<p>I turned to Ecamm&#8217;s <a href="http://www.ecamm.com/mac/phoneview/">PhoneView</a> program as it has been much Twittered about lately and is from the makers of the most excellent <a href="http://www.ecamm.com/mac/callrecorder/">Call Recorder</a> software (highly useful for Skype interviews). Along with providing access to SMS history (which is what I really wanted) it also claims to provide easy access to your iTunes media, photos, notes, call history and contacts, including the ability to drag and drop each file from the iPhone to your desktop.<br />
<span id="more-171600"></span><br />
After downloading the trial version, just plug in your iPhone and it will automagically recognize the device and load up the data from it:</p>
<div style="padding-bottom:12px; text-align:center"><a href="http://gigapple.files.wordpress.com/2008/08/phone-view-main.png"><img src="http://gigapple.files.wordpress.com/2008/08/phone-view-main.png?w=500&h=340" alt="" title="phone-view-main" width="500" height="340"  class=" alignleft" /></a></div>
<p>While I will not be showing the SMS retrieval portion (it would pretty much be a gigantic redacted block), the notes feature,</p>
<div style="padding-bottom:12px; text-align:center"><a href="http://gigapple.files.wordpress.com/2008/08/phone-view-new-note.png"><img src="http://gigapple.files.wordpress.com/2008/08/phone-view-new-note.png?w=500&h=311" alt="" title="phone-view-new-note" width="500" height="311"  class=" alignleft" /></a></div>
<p>call history feature (with export to tab-delimited file capability),</p>
<div style="padding-bottom:12px; text-align:center"><a href="http://gigapple.files.wordpress.com/2008/08/phone-view-new-call-log.png"><img src="http://gigapple.files.wordpress.com/2008/08/phone-view-new-call-log.png?w=500&h=391" alt="" title="phone-view-new-call-log" width="500" height="391"  class=" alignleft" /></a></div>
<p>and disk view mode make it a very handy tool.</p>
<div style="padding-bottom:12px; text-align:center"><a href="http://gigapple.files.wordpress.com/2008/08/phone-view-disk-view.png"><img src="http://gigapple.files.wordpress.com/2008/08/phone-view-disk-view.png?w=500&h=391" alt="" title="phone-view-disk-view" width="500" height="391"  class=" alignleft" /></a></div>
<p>This is one app where I highly recommend tweaking the default preferences since it will come up each time you connect your iPhone if you do not disable that ability.</p>
<div style="padding-bottom:12px; text-align:center"><a href="http://gigapple.files.wordpress.com/2008/08/phone-view-prefs.png"><img src="http://gigapple.files.wordpress.com/2008/08/phone-view-prefs.png?w=397&h=162" alt="" title="phone-view-prefs" width="397" height="162"  class=" alignleft" /></a></div>
<p>I was all set to purchase PhoneView, but kept having shopping cart issues and really wanted to get the SMS bits off of it prior to both clearing the SMS databases and installing iPhone OS 2.0.2, so I turned to a less interactive solution that requires a bit of command-line-fu.</p>
<p>First, grab <a href="http://calmstorm.net/iphone/unravel.perl">unravel</a>, a small Perl script which you will use to rifle through your iPhone backup files (which are liberally generated these days). Then, using the Finder&#8217;s &#8220;Go to Folder&#8230;&#8221; option (via the &#8220;Go&#8221; menu), enter: <code>~/Library/Application Support/MobileSync/Backup</code></p>
<div style="padding-bottom:12px; text-align:center"><a href="http://gigapple.files.wordpress.com/2008/08/go-to-folder-backup.png"><img src="http://gigapple.files.wordpress.com/2008/08/go-to-folder-backup.png?w=431&h=134" alt="" title="go-to-folder-backup" width="431" height="134"  class=" alignleft" /></a></div>
<p>Each of the weirdly named directories contains various backups of your iPhone data. Copy the Perl script to the most recently modified folder. Now, you <i>will</i> need the full path of that folder to continue and I suggest using either the Finder toolbar or keyboard-shortcut version of <a href="http://www.entropy.ch/blog/Mac+OS+X/2008/08/07/Open-Terminal-Here-Finder-Keyboard-Command.html">Open Terminal Here</a> to make your life much easier. Either manually, or via &#8220;Open Terminal Here&#8221;, fire up Terminal.app, change directories and run the Perl script (yours may be named <code>unravel.perl.pl</code> or <code>unravel.perl</code> depending on how you or your browser saved it).</p>
<div style="padding-bottom:12px; text-align:center"><a href="http://gigapple.files.wordpress.com/2008/08/unravel-run.png"><img src="http://gigapple.files.wordpress.com/2008/08/unravel-run.png?w=500&h=248" alt="" title="unravel-run" width="500" height="248"  class=" alignleft" /></a></div>
<p>You can browse the results by going to <code>~/iPhone/Backup</code> in the Finder. The SMS database is in <code>~/iPhone/Backup/Library/SMS</code> and I recommend grabbing the open source <a href="http://sourceforge.net/projects/sqlitebrowser/">SQLite Database Browser</a> to look at and export any of the SQLite databases.</p>
<div style="padding-bottom:12px; text-align:center"><a href="http://gigapple.files.wordpress.com/2008/08/sqlite-browser.png"><img src="http://gigapple.files.wordpress.com/2008/08/sqlite-browser.png?w=500&h=362" alt="" title="sqlite-browser" width="500" height="362"  class=" alignleft" /></a></div>
<p>If you can get through Ecamm&#8217;s shopping cart, the $19.95USD is a pretty good deal as it gives you a decent interface and free upgrades for life. If you just need to grab information once in a while or have some casual interest in what can be pulled from the iPhone backup files, then <code>unravel</code> may be a good option for you.</p>
<p>What extra tools do you use to manage your iPhone data? If you&#8217;ve used <code>unravel</code> or PhoneView, sound off in the comments!</p>
<p><strong>Related research and analysis from GigaOM Pro:</strong><br />Subscriber content. <a href="http://pro.gigaom.com/?utm_source=apple&utm_medium=editorial&utm_campaign=auto3&utm_term=171600+getting-a-handle-on-your-iphone-data-a-mini-tales-from-the-command-line-story&utm_content=hrbrmstr">Sign up for a free trial</a>.</p><ul><li><a href="http://pro.gigaom.com/2011/01/mobile-q4-all-eyes-were-on-android-4g-and-the-rising-tablet-tide/?utm_source=apple&amp;utm_medium=editorial&amp;utm_campaign=waterfall?utm_source=apple&utm_medium=editorial&utm_campaign=auto3&utm_term=171600+getting-a-handle-on-your-iphone-data-a-mini-tales-from-the-command-line-story&utm_content=hrbrmstr">Mobile Q4: All Eyes Were on Android, 4G and the Rising Tablet&nbsp;Tide</a></li><li><a href="http://pro.gigaom.com/2010/12/report-a-mobile-video-market-overview/?utm_source=apple&amp;utm_medium=editorial&amp;utm_campaign=waterfall?utm_source=apple&utm_medium=editorial&utm_campaign=auto3&utm_term=171600+getting-a-handle-on-your-iphone-data-a-mini-tales-from-the-command-line-story&utm_content=hrbrmstr">Report: A Mobile Video Market&nbsp;Overview</a></li><li><a href="http://pro.gigaom.com/2010/10/in-q3-the-tablet-and-4g-were-the-big-stories/?utm_source=apple&amp;utm_medium=editorial&amp;utm_campaign=waterfall?utm_source=apple&utm_medium=editorial&utm_campaign=auto3&utm_term=171600+getting-a-handle-on-your-iphone-data-a-mini-tales-from-the-command-line-story&utm_content=hrbrmstr">In Q3, the Tablet and 4G Were the Big&nbsp;Stories</a></li></ul><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=gigaom.com&#038;blog=14960843&#038;post=171600&#038;subd=gigaom2&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://gigaom.com/apple/getting-a-handle-on-your-iphone-data-a-mini-tales-from-the-command-line-story/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a08d08f6b541441fccf36bc6392a0784?s=96&#38;d=retro&#38;r=PG" medium="image">
			<media:title type="html">hrbrmstr</media:title>
		</media:content>

		<media:content url="http://gigapple.files.wordpress.com/2008/08/phoneview-icon.png" medium="image">
			<media:title type="html">phoneview-icon</media:title>
		</media:content>

		<media:content url="http://gigapple.files.wordpress.com/2008/08/phone-view-main.png" medium="image">
			<media:title type="html">phone-view-main</media:title>
		</media:content>

		<media:content url="http://gigapple.files.wordpress.com/2008/08/phone-view-new-note.png" medium="image">
			<media:title type="html">phone-view-new-note</media:title>
		</media:content>

		<media:content url="http://gigapple.files.wordpress.com/2008/08/phone-view-new-call-log.png" medium="image">
			<media:title type="html">phone-view-new-call-log</media:title>
		</media:content>

		<media:content url="http://gigapple.files.wordpress.com/2008/08/phone-view-disk-view.png" medium="image">
			<media:title type="html">phone-view-disk-view</media:title>
		</media:content>

		<media:content url="http://gigapple.files.wordpress.com/2008/08/phone-view-prefs.png" medium="image">
			<media:title type="html">phone-view-prefs</media:title>
		</media:content>

		<media:content url="http://gigapple.files.wordpress.com/2008/08/go-to-folder-backup.png" medium="image">
			<media:title type="html">go-to-folder-backup</media:title>
		</media:content>

		<media:content url="http://gigapple.files.wordpress.com/2008/08/unravel-run.png" medium="image">
			<media:title type="html">unravel-run</media:title>
		</media:content>

		<media:content url="http://gigapple.files.wordpress.com/2008/08/sqlite-browser.png" medium="image">
			<media:title type="html">sqlite-browser</media:title>
		</media:content>
	</item>
		<item>
		<title>Tales From The Command Line: What&#8217;s Going On? (lsof)</title>
		<link>http://gigaom.com/apple/tales-from-the-command-line-whats-going-on-lsof/</link>
		<comments>http://gigaom.com/apple/tales-from-the-command-line-whats-going-on-lsof/#comments</comments>
		<pubDate>Fri, 01 Aug 2008 13:00:35 +0000</pubDate>
		<dc:creator>Bob Rudis</dc:creator>
				<category><![CDATA[Commentary]]></category>
		<category><![CDATA[command line]]></category>
		<category><![CDATA[network]]></category>
		<category><![CDATA[open files]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[TCP/IP]]></category>

		<guid isPermaLink="false">http://theappleblog.com/?p=3933</guid>
		<description><![CDATA[As mentioned in the previous installment, there is a very useful command buried deep within the confines of your OS X terminal. This command &#8211; lsof (LiSt Open Files) &#8211; is like the Swiss Army knife of utilities, proving information on files, directories, volumes and even [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=gigaom.com&#038;blog=14960843&#038;post=171578&#038;subd=gigaom2&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><img src="http://gigapple.files.wordpress.com/2008/07/clix-icon.png?w=128&h=128" alt="" title="clix-icon" width="128" height="128"  class=" alignleft" />As mentioned in the <a href="http://gigaom.com/apple/tales-from-the-command-line-where-has-my-bandwidth-gone-iftop-surplusmeter/">previous installment</a>, there is a very useful command buried deep within the confines of your OS X terminal. This command &#8211; <code>lsof</code> (<b>L</b>i<b>S</b>t <b>O</b>pen <b>F</b>iles) &#8211; is like the Swiss Army knife of utilities, proving information on files, directories, volumes and even what is happening on the network. Unlike <code>iftop</code>, <code>lsof</code> does not require any downloads. Simply open up a Terminal.app session and enter: <code>lsof</code>.</p>
<p>Give that command a minute to run and prepare to be overwhelmed with information in a cryptic, textual, tabular format. The command, used in that way, is actually pretty useless (from an interactive standpoint). Its true power becomes unleashed with the proper command-line options, execution privileges and when grouped with some other command-line-fu. After the small primer in this post, you should be well equipped to figure out what applications are talking on the network, what files your applications have open and what is keeping your volumes from being able to be ejected.</p>
<p>Before we begin, it may be a bit confusing when a utility that claims to list open <i>files</i> can provide information on <i>network</i> traffic. You have to remember that in OS X (UNIX-like systems in general) an open file may be a regular file, a directory, a block special (enables communication with device drivers) file, a character special (facilitates communication with a device one character at a time) file, a library, a stream or a network file (i.e. a network connection).</p>
<p>The examples in this post also make heavy use of <a href="http://rixstep.com/4/0/clix/">CLIX</a> (Command Line Interface for OS *X*). As you&#8217;ll see, <code>lsof</code> output can be a bit much for those just getting started with <code>Terminal.app</code> and CLIX provides a nice wrapper around the OS X command line utilities and allows you to keep similar commands organized with a much friendlier output window than the Terminal. It comes with an amazing set of pre-built command libraries that are well worth the time to go through. You will come away with a great education on the innards of OS X.<br />
<span id="more-171578"></span></p>
<h3>Files A-Plenty</h3>
<p>While we do ultimately want to use <code>lsof</code> to find out what is happening on the network, seeing just what is &#8220;open&#8221; at any given moment on your Mac can be quite eye-opening. If you installed CLIX, navigate to the &#8220;CLIX Command Files&#8221; folder and double-click <code>list.clix</code>.</p>
<div style="text-align:center;padding-bottom:12px"><img src="http://gigapple.files.wordpress.com/2008/07/clix-list.png?w=102&h=98" alt="" title="clix-list" width="102" height="98"  class=" alignleft" /></div>
<div style="text-align:center;padding-bottom:12px"><img src="http://gigapple.files.wordpress.com/2008/07/clix-open-files.png?w=500&h=329" alt="" title="clix-open-files" width="500" height="329"  class=" alignleft" /></div>
<p>Sort the list that comes up by &#8220;Title&#8221; and locate &#8220;Open Files&#8221;, double-click and  (command-line purists can just run <code>lsof -l +L -R -V</code>).</p>
<div style="text-align:center;padding-bottom:12px"><img src="http://gigapple.files.wordpress.com/2008/07/clix-open-files-run.png?w=500&h=265" alt="" title="clix-open-files-run" width="500" height="265"  class=" alignleft" /></div>
<p>You should see a fairly substantial output list. These are all the open files you can see with your user privileges. CLIX has an option to enter your administrative password (Edit->Sudo&#8230;) that will let the <code>lsof</code> command use admin privileges (which will make the list even more substantial) if you prefix it with <code>sudo</code> (and a space). It can be very useful to add a series of CLIX entries with &#8220;<code>sudo</code>&#8221; prefixes to commands like <code>lsof</code> if you find yourself using them quite a bit.</p>
<p>A small modification (which you can add as an item to &#8220;list.clix&#8221; or just enter in the terminal gives you a way to see what process (application) has a file open on a mounted volume (which is problematic if you want to eject that volume). Just enter:</p>
<p><code>lsof -l +L -R -V | grep "/Volumes"</code></p>
<p>and look through the first and last columns to tie application name to the resource it has open. You can see from my example that Preview has one graphic open on another volume. You may need to execute this as <code>sudo lsof -l +L -R -V | grep "/Volumes"</code> if your user privleges are not sufficient to see what is open (this should not be the case, but it can help find those stubborn open files that are keeping your disk from dismounting).</p>
<div style="text-align:center;padding-bottom:12px"><img src="http://gigapple.files.wordpress.com/2008/07/clix-check-volume.png?w=500&h=176" alt="" title="clix-check-volume" width="500" height="176"  class=" alignleft" /></div>
<p>A further small modification is to see what a particular application (process) has open. Simple change the command to be: <code>lsof -l +L -R -V -c Safari</code> (change &#8220;Safari&#8221; to the app you are interested in) and the output will be filtered to only include what is open by what you specify.</p>
<h3>What Goes Where?</h3>
<p>Back in CLIX, navigate to &#8220;Open Network Files&#8221; and run that command line (<code>lsof -l -i +L -R -V</code>) [again, prefix this with <code>sudo</code> to see more entries].</p>
<div style="text-align:center;padding-bottom:12px"><img src="http://gigapple.files.wordpress.com/2008/07/clix-open-network-files-run.png?w=500&h=265" alt="" title="clix-open-network-files-run" width="500" height="265"  class=" alignleft" /></div>
<p>In this example, you can see that:</p>
<ul>
<li>the Finder is connected to the local machine</li>
<li>Radioshift is listening for connetions</li>
<li>Dropbox is super busy</li>
<li>SystemUIServer (a background process that controls several aspects of the Mac OS X user interface) is chillin&#8217;</li>
<li>and Safari &#038; Adium are engaged in some sort of external communication (both of which seem valid)</li>
</ul>
<p>What you should be looking out for are network connections to or from destinations that you do not recognize or unfamiliar application (process) names that are engaged in network communication. Generally speaking, if you do not recognize the name (when running without <code>sudo</code>) then you may have some not-so-cool things going on.</p>
<h3>A More Mac-like Experience</h3>
<p>It&#8217;s A Very Good Thing to know how things work under the hood, but you may be the type of user who – like most drivers – want someone else to &#8220;change the oil&#8221;. As has been indicated previously, <a href="http://www.obdev.at/products/littlesnitch/index.html">Little Snitch</a> is a great program to both help you detect what is going on and give you control over it. The app is not free – it costs $29.95 – but if it helps prevent even one bad connection from getting through, then it may be a very justifiable expense.</p>
<p>If you have any questions or suggestions on this topic or come up with a cool CLIX command library you want to share, definitely drop a note in the comments.</p>
<p><strong>Related research and analysis from GigaOM Pro:</strong><br />Subscriber content. <a href="http://pro.gigaom.com/?utm_source=apple&utm_medium=editorial&utm_campaign=auto3&utm_term=171578+tales-from-the-command-line-whats-going-on-lsof&utm_content=hrbrmstr">Sign up for a free trial</a>.</p><ul><li><a href="http://pro.gigaom.com/2011/03/why-ipad-2-will-lead-consumers-into-the-post-pc-era/?utm_source=apple&amp;utm_medium=editorial&amp;utm_campaign=waterfall?utm_source=apple&utm_medium=editorial&utm_campaign=auto3&utm_term=171578+tales-from-the-command-line-whats-going-on-lsof&utm_content=hrbrmstr">Why iPad 2 Will Lead Consumers Into the Post-PC&nbsp;Era</a></li><li><a href="http://pro.gigaom.com/2011/03/the-near-term-evolution-of-social-commerce/?utm_source=apple&amp;utm_medium=editorial&amp;utm_campaign=waterfall?utm_source=apple&utm_medium=editorial&utm_campaign=auto3&utm_term=171578+tales-from-the-command-line-whats-going-on-lsof&utm_content=hrbrmstr">The Near-Term Evolution of Social&nbsp;Commerce</a></li><li><a href="http://pro.gigaom.com/2011/02/content-farms-the-players-the-benefits-the-risks/?utm_source=apple&amp;utm_medium=editorial&amp;utm_campaign=waterfall?utm_source=apple&utm_medium=editorial&utm_campaign=auto3&utm_term=171578+tales-from-the-command-line-whats-going-on-lsof&utm_content=hrbrmstr">Content Farms: The Players, The Benefits, The&nbsp;Risks</a></li></ul><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=gigaom.com&#038;blog=14960843&#038;post=171578&#038;subd=gigaom2&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://gigaom.com/apple/tales-from-the-command-line-whats-going-on-lsof/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a08d08f6b541441fccf36bc6392a0784?s=96&#38;d=retro&#38;r=PG" medium="image">
			<media:title type="html">hrbrmstr</media:title>
		</media:content>

		<media:content url="http://gigapple.files.wordpress.com/2008/07/clix-icon.png" medium="image">
			<media:title type="html">clix-icon</media:title>
		</media:content>

		<media:content url="http://gigapple.files.wordpress.com/2008/07/clix-list.png" medium="image">
			<media:title type="html">clix-list</media:title>
		</media:content>

		<media:content url="http://gigapple.files.wordpress.com/2008/07/clix-open-files.png" medium="image">
			<media:title type="html">clix-open-files</media:title>
		</media:content>

		<media:content url="http://gigapple.files.wordpress.com/2008/07/clix-open-files-run.png" medium="image">
			<media:title type="html">clix-open-files-run</media:title>
		</media:content>

		<media:content url="http://gigapple.files.wordpress.com/2008/07/clix-check-volume.png" medium="image">
			<media:title type="html">clix-check-volume</media:title>
		</media:content>

		<media:content url="http://gigapple.files.wordpress.com/2008/07/clix-open-network-files-run.png" medium="image">
			<media:title type="html">clix-open-network-files-run</media:title>
		</media:content>
	</item>
		<item>
		<title>Tales From The Command Line: Where Has My Bandwidth Gone? (iftop &amp; SurplusMeter)</title>
		<link>http://gigaom.com/apple/tales-from-the-command-line-where-has-my-bandwidth-gone-iftop-surplusmeter/</link>
		<comments>http://gigaom.com/apple/tales-from-the-command-line-where-has-my-bandwidth-gone-iftop-surplusmeter/#comments</comments>
		<pubDate>Thu, 03 Jul 2008 14:00:28 +0000</pubDate>
		<dc:creator>Bob Rudis</dc:creator>
				<category><![CDATA[Asides]]></category>
		<category><![CDATA[Walkthroughs]]></category>
		<category><![CDATA[bandwidth]]></category>
		<category><![CDATA[command line]]></category>
		<category><![CDATA[terminal]]></category>

		<guid isPermaLink="false">http://theappleblog.com/?p=3622</guid>
		<description><![CDATA[I believe I can safely say that the primary objective for users running OS X is to connect to the Internet to read mail, check out web sites, chat with friends, download new apps or grab/share multi-media content, etc. With bandwidth caps staring to become all [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=gigaom.com&#038;blog=14960843&#038;post=171525&#038;subd=gigaom2&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><img src="http://gigapple.files.wordpress.com/2008/07/surplus-icon.png?w=128&h=128" alt="" title="surplus-icon" width="128" height="128"  class=" alignleft" />I believe I can safely say that the primary objective for users running OS X is to connect to the Internet to read mail, check out web sites, chat with friends, download new apps or grab/share multi-media content, etc. With <a href="http://arstechnica.com/news.ars/post/20080603-40gb-for-55-per-month-time-warner-bandwidth-caps-arrive.html">bandwidth caps</a> staring to become all the rage by the mega-providers, knowing how much you are consuming may be critical knowledge to hold back the costs/fees on your monthly bill.</p>
<p>This post covers two of three key programs for managing bandwidth: <code>iftop</code> (a command-line utility) and <b>SurplusMeter</b> (a GUI tool). The third utility &#8211; <code>lsof</code> (another command-line utility) &#8211; will require a dedicated article in-and-of itself.</p>
<h3>How Much Am I Consuming?</h3>
<p><a href="http://freespace.virgin.net/jeremy.dronfield/skoobysoft/skooby/download.html">SurplusMeter</a> is a small tool from the fine folks over at SkoobySoft with one mission: to show you how much bandwidth you are consuming with the option to enter any known caps to ensure you are not over your limit. You can download SurpluMeter <a href="http://freespace.virgin.net/jeremy.dronfield/skoobysoft/downloads/SurplusMeterv201.dmg">directly from their site</a>. It is a PPC binary compatible down to OS X 10.3.9. For those who want to live life on the wild side, you can <a href="http://freespace.virgin.net/jeremy.dronfield/skoobysoft/downloads/SurplusMeter_source201.tgz">grab the source code</a> and compile it yourself. I have built an OS X 10.5 compatible Universal Binary version which you can <a href="http://theappleblog.com/wp-content/uploads/2008/07/surplusmeter.zip">download via this post</a>. No matter which way you decide to go, it is important to copy the application to your local volume as it runs an agent program &#8211; which runs in the background collecting bandwidth data &#8211; that will make it difficult to remove mounted volumes if you keep it running.</p>
<div style="text-align:center;padding-bottom:12px"><img src="http://gigapple.files.wordpress.com/2008/07/surplus-meter-main-view.png?w=486&h=478" alt="" title="surplus-meter-main-view" width="486" height="478"  class=" alignleft" /></div>
<p>The main view of SurplusMeter is fairly straightforward. You can set which day to start the monthly tracking period on and specify your known bandwidth cap &#8211; which can also include upstream usage. Monitoring can be paused if you know you will be moving between networks, the collected data can be reset and you can even choose which interface to monitor via their &#8220;English&#8221; names vs OS X short device names (e.g. &#8220;Ethernet port&#8221; vs &#8220;<code>en0</code>&#8220;). For my example, I did a short sample of bandwidth on my AT&#038;T 3G ExpressCard, hence the <code>PPP modem</code> selection. If there were hiccups during program execution or you know of other bandwidth usage on your connection not emanating from your Mac, you can add bytes to the current data collector.</p>
<div style="text-align:center;padding-bottom:12px"><img src="http://gigapple.files.wordpress.com/2008/07/surplus-meter-add-bytes.png?w=486&h=478" alt="" title="surplus-meter-add-bytes" width="486" height="478"  class=" alignleft" /></div>
<p>Similarly, you can also remove bytes if you were measuring data on an interface that moved between networks.</p>
<div style="text-align:center;padding-bottom:12px"><img src="http://gigapple.files.wordpress.com/2008/07/surplus-meter-remove-bytes.png?w=486&h=478" alt="" title="surplus-meter-remove-bytes" width="486" height="478"  class=" alignleft" /></div>
<p>SurplusMeter is kind enough to store its data in <code>~/Library/Application Support/SurplusMeter/surplusmeter_data.plist</code> in a very human- and machine-readable format (a well-annoted Apple plist) so you can do what you like with it:</p>
<div style="text-align:center;padding-bottom:12px"><img src="http://gigapple.files.wordpress.com/2008/07/surplus-meter-plist.png?w=495&h=370" alt="" title="surplus-meter-plist" width="495" height="370"  class=" alignleft" /></div>
<p>In general, it is a great, special purpose utility to have around.</p>
<h3>What&#8217;s Going On Here?</h3>
<p>SurplusMeter tells you that you are using bandwidth, but does not provide any further details. This is where tool number two &#8211; <code>iftop</code> &#8211; comes into play. You can grab a pre-built package of <code>iftop</code> (&#8220;interface top&#8221;) from <a href="http://www.afp548.com/article.php?story=20070507113337840">AFP548.com</a> or <a href="http://www.ex-parrot.com/~pdw/iftop/">grab the source</a> and try your hand at building it (you may need to download some support libraries). Users of various &#8220;ports&#8221; tools should be able to find <code>iftop</code> in one of the repositories.</p>
<p>Where the command-line tool <code>top</code> provides a mechanism for determining what processes are consuming precious system resources (in a very similar fashion to the <b>Activity Monitor</b> application), <code>iftop</code> does something similar for network usage on a particular interface.</p>
<p>You will need some more technical information to run <code>iftop</code> successfully. First, you will need to know which network interface you want to monitor. To find out which interfaces you have on your system, open <b>Terminal.app</b> and run the command:</p>
<blockquote><p><code>ifconfig -l</code></p></blockquote>
<p>My output from that shows:</p>
<blockquote><p><code>lo0 gif0 stf0 en0 fw0 en1 vmnet8 vmnet1 ppp0</code></p></blockquote>
<p>Interface <code>en0</code> <i>generally</i> is equivalent to &#8220;Ethernet&#8221; and <code>en1</code> is <i>usually</i> equivalent to your AirPort card. <code>ppp0</code> would refer to most modems, including 3G cards. Additional interfaces may be related to a VMware or Parallels install, your local firewall interface or other local types of network devices.</p>
<p>With Terminal.app open, run <code>iftop -h</code> to see what the command line options are for the tool:</p>
<pre style="padding-bottom:12px">Synopsis: iftop -h | [-npbBP] [-i interface] [-f filter code] [-N net/mask]

   -h                  display this message
   -n                  don't do hostname lookups
   -N                  don't convert port numbers to services
   -p                  run in promiscuous mode (show traffic between other
                       hosts on the same network segment)
   -b                  don't display a bar graph of traffic
   -B                  Display bandwidth in bytes
   -i interface        listen on named interface
   -f filter code      use filter code to select packets to count
                       (default: none, but only IP packets are counted)
   -F net/mask         show traffic flows in/out of network
   -P                  show ports as well as hosts
   -m limit            sets the upper limit for the bandwidth scale
   -c config file      specifies an alternative configuration file</pre>
<p>For this example, the most useful options are &#8220;<code>-i</code>&#8221; to let us choose which interface to monitor and &#8220;<code>-P</code>&#8221; to show which ports are in use. The tool requires elevated privileges to work so you have to run the following to start your view: <code>sudo iftop -P -i ppp0</code> (again, replace &#8220;<code>ppp0</code>&#8221; with &#8220;<code>en0</code>&#8221; or &#8220;<code>en1</code>&#8221; or whatever interface you need to monitor).</p>
<p>You should see something similar to the following screen upon successful execution (minus the annotation):</p>
<div style="text-align:center;padding-bottom:12px"><img src="http://gigapple.files.wordpress.com/2008/07/iftop-itunes-annotated.png?w=500&h=457" alt="" title="iftop-itunes-annotated" width="500" height="457"  class=" alignleft" /></div>
<p>The main part of the display lists, for each pair of hosts, the rate at which data  has been sent and received over the preceding 2, 10 and 40 second intervals. The direction of data flow is  indicated  by  arrows,  <=  and  =>. So in this example, where I started iTunes just after kicking off <code>iftop</code>, we can see that:</p>
<ul>
<li>166.129.237.160 (my local machine) made a series of http (web) requests to Apple servers</li>
<li>some of Apple&#8217;s servers do not resolve from IP addresses to host names</li>
<li>the average transfer rate over 40 seconds is between 0.2 kilobytes and 9 kilobytes per second</li>
</ul>
<p>After quitting iTunes and running for a while, then letting it sit &#8220;idle&#8221; (not actively doing network activity), you can see that the pattern of usage can change dramatically.</p>
<div style="text-align:center;padding-bottom:12px"><img src="http://gigapple.files.wordpress.com/2008/07/iftop-idle-annotated.png?w=500&h=455" alt="" title="iftop-idle-annotated" width="500" height="455"  class=" alignleft" /></div>
<p>While <code>iftop</code> can let you see more of what is going on, it cannot tell you which applications or processes are causing the usage. You can infer quite a bit (i.e. http traffic is most likely coming from your browser &#8211; but this is not necessarily the case as shown by the last screen), but finding out core details is where <code>lsof</code> can be of real value and will be covered in our next installment.</p>
<p>While I have presented a free way to monitor bandwidth usage, Guy Meyer has a set of tools &#8211; <a href="http://homepage.mac.com/rominar/net.html">Net Monitor</a> &#038; <a href="http://homepage.mac.com/rominar/sidekick.html">Net Monitor Sidekick</a> which do something similar but are not free (the Sidekick program is in beta which is expired so I was not able to test it).</p>
<p>If you are using any of these or similar tools to monitor bandwidth utilization, drop a note in the comments to share your insights with TAB readers and keep an eye out for our post on <code>lsof</code>!</p>
<p><strong>Related research and analysis from GigaOM Pro:</strong><br />Subscriber content. <a href="http://pro.gigaom.com/?utm_source=apple&utm_medium=editorial&utm_campaign=auto3&utm_term=171525+tales-from-the-command-line-where-has-my-bandwidth-gone-iftop-surplusmeter&utm_content=hrbrmstr">Sign up for a free trial</a>.</p><ul><li><a href="http://pro.gigaom.com/2011/03/why-ipad-2-will-lead-consumers-into-the-post-pc-era/?utm_source=apple&amp;utm_medium=editorial&amp;utm_campaign=waterfall?utm_source=apple&utm_medium=editorial&utm_campaign=auto3&utm_term=171525+tales-from-the-command-line-where-has-my-bandwidth-gone-iftop-surplusmeter&utm_content=hrbrmstr">Why iPad 2 Will Lead Consumers Into the Post-PC&nbsp;Era</a></li><li><a href="http://pro.gigaom.com/2011/03/the-near-term-evolution-of-social-commerce/?utm_source=apple&amp;utm_medium=editorial&amp;utm_campaign=waterfall?utm_source=apple&utm_medium=editorial&utm_campaign=auto3&utm_term=171525+tales-from-the-command-line-where-has-my-bandwidth-gone-iftop-surplusmeter&utm_content=hrbrmstr">The Near-Term Evolution of Social&nbsp;Commerce</a></li><li><a href="http://pro.gigaom.com/2011/02/content-farms-the-players-the-benefits-the-risks/?utm_source=apple&amp;utm_medium=editorial&amp;utm_campaign=waterfall?utm_source=apple&utm_medium=editorial&utm_campaign=auto3&utm_term=171525+tales-from-the-command-line-where-has-my-bandwidth-gone-iftop-surplusmeter&utm_content=hrbrmstr">Content Farms: The Players, The Benefits, The&nbsp;Risks</a></li></ul><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=gigaom.com&#038;blog=14960843&#038;post=171525&#038;subd=gigaom2&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://gigaom.com/apple/tales-from-the-command-line-where-has-my-bandwidth-gone-iftop-surplusmeter/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a08d08f6b541441fccf36bc6392a0784?s=96&#38;d=retro&#38;r=PG" medium="image">
			<media:title type="html">hrbrmstr</media:title>
		</media:content>

		<media:content url="http://gigapple.files.wordpress.com/2008/07/surplus-icon.png" medium="image">
			<media:title type="html">surplus-icon</media:title>
		</media:content>

		<media:content url="http://gigapple.files.wordpress.com/2008/07/surplus-meter-main-view.png" medium="image">
			<media:title type="html">surplus-meter-main-view</media:title>
		</media:content>

		<media:content url="http://gigapple.files.wordpress.com/2008/07/surplus-meter-add-bytes.png" medium="image">
			<media:title type="html">surplus-meter-add-bytes</media:title>
		</media:content>

		<media:content url="http://gigapple.files.wordpress.com/2008/07/surplus-meter-remove-bytes.png" medium="image">
			<media:title type="html">surplus-meter-remove-bytes</media:title>
		</media:content>

		<media:content url="http://gigapple.files.wordpress.com/2008/07/surplus-meter-plist.png" medium="image">
			<media:title type="html">surplus-meter-plist</media:title>
		</media:content>

		<media:content url="http://gigapple.files.wordpress.com/2008/07/iftop-itunes-annotated.png" medium="image">
			<media:title type="html">iftop-itunes-annotated</media:title>
		</media:content>

		<media:content url="http://gigapple.files.wordpress.com/2008/07/iftop-idle-annotated.png" medium="image">
			<media:title type="html">iftop-idle-annotated</media:title>
		</media:content>
	</item>
	</channel>
</rss>
