« Back to Index

ls command behave like tree command

View original Gist on GitHub

ls like tree output.sh

   .
   |-lib
   |---composition
   |-----error
   |-----page
   |-----response
   |-----routing
   |-----schema
   |-spec
   |---composition
   |-----page
   |-----response
   |-----schema
   |---fixtures
   |---integration

ls like tree.sh

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