Viewing the Directory Tree
There are 2 commands we will learn for viewing our directory tree.
The first one is the ls
command. We know that using this command will display the directories and files in our current directory. But we can also see down into the directories within our current directory using the -R option. Yes it is a capital R.
ls -R
ls -R /var/log
The second way is with the tree
command. Simply calling the command without options or arguments will display the directory tree for our current directory and all of its children in a beautiful easy to read format.
tree
If we include an argument the tree
command will display the directory tree of the directory we provide
tree /var/log
The tree
command does not come pre-installed on Linux. So it is not available on some Linux installations. It is installed for your use on scratch.