//View Tip #209
Similar Tips
» Find files by mime-type
» Mass-renaming files
» Find last modified files on a filesystem
» Replace expr by other recursively
» Number each line of a file


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 »


Add your comment

Comments are currently disabled
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