//View Tip #209
Similar Tips
» SSH Auto Complete
» Remove empty directories
» Using Perl instead of Sed
» Remove DS_Store files from shared folders
» Convert permissions to octal

 

Latest tips by RSS
Click here to subscribe
Follow Shell-Fu on Twitter
Click here to follow
Follow Shell-Fu on identi.ca
Click here to follow
The following alias will print the directory structure from the current directory in tree format.

alias dirf='find . -type d | sed -e "s/[^-][^\/]*\//  |/g" -e "s/|\([^ ]\)/|-\1/"'


View Comments »




Comments 

Add your comment

Comments are currently disabled
gnu
Same function, but better readability has the programm tree. Portage (gentoo) says  
[I] app-text/tree
    Homepage:            http://mama.indstate.edu/users/ice/tree/
    Description:         Lists directories recursively, and produces an indented listing of files.

But nice to see, that there is a one line implementation.
Posted 2009-06-07 10:06:03

Home Latest Browse Top 25 Random Hall Of Fame Contact Submit