Is there any linux command that I can call from a Bash script that will print the directory structure in the form of a tree, e.g.,
folder1
a.txt
b.txt
folder2
folder3
Is there any linux command that I can call from a Bash script that will print the directory structure in the form of a tree, e.g.,
folder1
a.txt
b.txt
folder2
folder3
To add Hassou's solution to your .bashrc, try:
is this what your looking for tree, should be in most distributions (maybe as an optional install)?
sample taken from maintainers web page.
You can add the option
-L #
where#
is replaced by a number, to specify the max recursivity level.Remove
-d
to display also files.You can use this one:
It will show a graphical representation of the current sub-directories without files in a few seconds, e.g. in /var/cache/:
Source