The tree command produces a recursive, depth indented directory/file listing, followed by a count of the number of files and directories found.
By default the tree command is not installed. Type one of the following according to the type of Linux installation you have.
$ sudo apt-get install tree $ yum install tree
To list the contents of the directory test, descending all paths, type the following
$ tree test tree |-- foo1.txt |-- foo2.txt '-- foodir '-- foo3.txt
To limit the directory level descended into append the option -L to the tree command followed by the number of levels you wish to limit to.
$ tree test -L 1 tree |-- foo1.txt |-- foo2.txt '-- foodir