Print the directory tree in Linux’s terminal

You can use tree command to print the directory tree in a terminal, just install “tree” application:

root# apt-get install tree

or use find and sed 😉

find . -type d | sed -e "s/[^-][^\/]*\// |/g" -e "s/|\([^ ]\)/|-\1/"

Leave a Reply

Your email address will not be published. Required fields are marked *

*