Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: One liner to print a file system tree on UNIX like systems

by toolic (Bishop)
on Aug 21, 2013 at 13:35 UTC ( #1050349=note: print w/replies, xml ) Need Help??


in reply to One liner to print a file system tree on UNIX like systems

Golf! Fewer strokes...
ls -R | perl -ne'if(s/:$//){s{[^/]*/}{--}g;s/^-/\t|/;print}'

Or just tree -d