Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

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

by ciderpunx (Vicar)
on Aug 21, 2013 at 13:08 UTC ( [id://1050343]=CUFP: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    ls -R | perl -ne 'if(/:$/){s/:$//;s/[^\/]*\//--/g;s/^-/\t|/;print}'
    
  2. or download this
    $ ls -R | perl -ne 'if(/:$/){s/:$//;s/[^\/]*\//--/g;s/^-/\t|/;print}'
        |---branches
    ...
        |-------Reader
        |-----Output
        |-------Writer
    

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: CUFP [id://1050343]
Approved by Corion
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (2)
As of 2024-07-25 05:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    erzuuli‥ 🛈The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.