[lug] linux utility to list files hierarchically

Walter Pienciak walter at pienciak.org
Mon Feb 27 08:13:10 MST 2006


On Fri, Feb 24, 2006 at 05:08:40PM -0700, Nate Duehr wrote:
> Walter Pienciak wrote:
> 
> >find . -print | sed -e 's,[^/]*/\([^/]*\)$,`--\1,' -e 's,[^/]*/,| ,g' 
> >
> >Walter
> 
> That's a nifty sed trick, Walter!
> 
> There's a bug hiding in it.  It's printing ` in front of everything 
> though!
> 
> ( GRIN -- you'll see it.  You have an extra character in there, unless 
> you wanted that ` in front of --. )
> 
> Thanks for sharing that one, that one's going in my hints/tricks IMAP 
> folder.
> 
> It will come in handy... I'm sure!
> 
> Nate

Glad you liked it;  an oldie but goodie.  That one char was
intentional -- just bad ASCII art depiction of a tree -- add your
own salt and pepper to taste.

Walter



More information about the LUG mailing list