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
command linelinux
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
Best Answer
Is this what you're looking for tree? It should be in most distributions (maybe as an optional install).
sample taken from maintainer's web page.
You can add the option
-L #
where#
is replaced by a number, to specify the max recursion depth.Remove
-d
to display also files.