<?xml version="1.0"?>
<rss version="2.0">
<channel>
  <title>Spikes Of Nothingness - folder tag</title>
  <link>http://weblog.flop.ca/tags/folder/</link>
  <description>Florin T.PATRASCU&#039;s blog</description>
  <language>en</language>
  <copyright>Florin T.PATRASCU</copyright>
  <lastBuildDate>Sat, 12 May 2012 02:12:08 GMT</lastBuildDate>
  <generator>Pebble (http://pebble.sourceforge.net)</generator>
  <docs>http://backend.userland.com/rss</docs>
  
  
  <item>
    <title>Display folder contents as a tree structure</title>
    <link>http://weblog.flop.ca/2007/05/27/1180277848764.html</link>
    
      
        <description>
          &lt;p&gt;  A lot of times I had to do acrobatics to be able to display the contents of a UNIX folder as a tree.&amp;nbsp; Well, no more! &lt;br /&gt;
&lt;br /&gt;
Looking for using the &lt;strong&gt;ls&lt;/strong&gt; command in various combinations I found this command gem:&lt;br /&gt;
&lt;/p&gt;
&lt;blockquote&gt;&lt;strong&gt;    &lt;font size=&#034;3&#034; color=&#034;#333399&#034;&gt;ls -R | grep &amp;quot;:$&amp;quot; | sed -e &#039;s/:$//&#039; -e &#039;s/[^-][^\/]*\//--/g&#039; -e &#039;s/^/ &amp;nbsp; /&#039; -e &#039;s/-/|/&#039;&lt;/font&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;/blockquote&gt;So for a folder where the standard: &lt;font color=&#034;#333399&#034;&gt;&lt;strong&gt;ls webapps/hello/&lt;/strong&gt;&lt;/font&gt; will display this:&lt;br /&gt;
&lt;font color=&#034;#333399&#034;&gt;&lt;br /&gt;
WEB-INF&amp;nbsp;&amp;nbsp; actions&amp;nbsp;&amp;nbsp; content&amp;nbsp;&amp;nbsp; pages&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public&amp;nbsp;&amp;nbsp;&amp;nbsp; templates&lt;br /&gt;
&lt;/font&gt;&lt;br /&gt;
The new command trick:&amp;nbsp; &lt;font color=&#034;#333399&#034;&gt;&lt;strong&gt;ls -R webapps/hello/ | grep &amp;quot;:$&amp;quot; | sed -e &#039;s/:$//&#039; -e &#039;s/[^-][^\/]*\//--/g&#039; -e &#039;s/^/&amp;nbsp;&amp;nbsp; /&#039; -e &#039;s/-/|/&#039;, &lt;/strong&gt;&lt;/font&gt;will display:&lt;br /&gt;
&lt;br /&gt;
&lt;font color=&#034;#333399&#034;&gt;&amp;nbsp;&amp;nbsp; |---/WEB-INF&lt;br /&gt;
&amp;nbsp;&amp;nbsp; |-----classes&lt;br /&gt;
&amp;nbsp;&amp;nbsp; |---/actions&lt;br /&gt;
&amp;nbsp;&amp;nbsp; |---/content&lt;br /&gt;
&amp;nbsp;&amp;nbsp; |---/pages&lt;br /&gt;
&amp;nbsp;&amp;nbsp; |---/public&lt;br /&gt;
&amp;nbsp;&amp;nbsp; |-----styles&lt;br /&gt;
&amp;nbsp;&amp;nbsp; |---/templates&lt;/font&gt;&lt;br /&gt;
&lt;br /&gt;
Neat, eh?&lt;br /&gt;
&lt;br /&gt;
There is also a nice script wrapper for the above command, follow this &lt;a href=&#034;http://www.centerkey.com/tree/&#034;&gt;link&lt;/a&gt; for more.
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
        </description>
      
      
    
    
    
    <category>osx</category>
    
    <comments>http://weblog.flop.ca/2007/05/27/1180277848764.html#comments</comments>
    <guid isPermaLink="true">http://weblog.flop.ca/2007/05/27/1180277848764.html</guid>
    <pubDate>Sun, 27 May 2007 14:57:28 GMT</pubDate>
  </item>
  
  </channel>
</rss>

