Wednesday, March 16, 2011

List Sub directories in tree format

ls -R | grep ":$" | sed -e 's/:$//' -e 's/[^-][^\/]*\//--/g' -e 's/^/ /' -e 's/-/|/'

1 comment:

  1. ya muth i have run above cmd
    i got tree format
    thanks lot

    ouput sample

    bash-3.00$ ls -R | grep ":$" | sed -e 's/:$//' -e 's/[^-][^\/]*\//--/g' -e 's/^/ /' -e 's/-/|/'
    .
    |-analysis
    |-analysis.old
    bash-3.00$

    ReplyDelete