tags:

views:

348

answers:

3

Is there some *nix tool or perl/php library that will let you easily create directory tree visualizations that look like the following?

www
|-- private
|    |-- app 
|    |    |-- php
|    |    |    |-- classes
|    |    |    +-- scripts
|    |    |-- settings
|    |    +-- sql
|    +-- lib
|         +-- ZendFramework-HEAD
+-- public
 |-- css
 |-- images
 +-- scripts
+11  A: 

How about this example from Unix Tree / Linux Tree:

ls -R | grep ":$" | sed -e 's/:$//' -e 's/[^-][^\/]*\//--/g' -e 's/^/   /' -e 's/-/|/'
bobbymcr
You gotta love a one-liner
pavium
Also works on my Mac! Thank you!
lexu
That's disgustingly awesome, but part of what I like about the output above is how it's not all dashes to the files, you get those pipes connecting subdirectories vertically
Alan Storm
You might check this person's solution out then: http://sandeep-vaniya.blogspot.com/2008/04/perl-script-for-directory-tree.html
bobbymcr
+1  A: 

Have a look at App::Asciio

/I3az/

draegtun
+2  A: 

I realize this question was answered ages ago, but I just found this program called tree which is pretty cool too.

Ibrahim