I want to simulate a tree command using Shell Script that displays all the directories recursively in this format:
tree
. |-- Lorem |-- Lorem |-- Lor
You can just launch :
tree .
OR
tree $absolute/path/of/your/dir
If you want to display the hidden files. By default tree does not print hidden files (those beginning with a dot '.'), just type:
tree -a .
This is what tree command do.