[lug] linux utility to list files hierarchically

Walter Pienciak walter at pienciak.org
Thu Feb 23 12:27:52 MST 2006


On Thu, Feb 23, 2006 at 10:56:34AM -0800, Dan Julio wrote:
> Hey All,
> 
> i must be dense or something but I cannot find any
> utility to list files as shown below (or anyway that
> shows the parent/child relationships in a text
> format):
> 
> top
>   + sub directory 1
>   |   +-- sub sub directory 1
>   |       + file in sub sub directory 1
>   + sub directory 2
>       + file in subdirectory 2
> 
> Any suggestions?
> 
> Thanks, Dan

find . -print | sed -e 's,[^/]*/\([^/]*\)$,`--\1,' -e 's,[^/]*/,| ,g' 

Walter



More information about the LUG mailing list