- [Instructor] Hello again,
and welcome to the last video of section three,
printing the directory tree.
In the previous video we learned about counting
the number of lines, words and characters in a line.
In this video we'll see how to monitor scripts
that help to look at the file system
using easy-to-read tree representations.
Graphically representing directories and file systems
as a tree hierarchy is quite useful
when preparing tutorials and documents.
Also they are sometimes useful in writing
certain monitoring scripts that help to look
at the file system using easy-to-read tree representations.
The tree command is the hero that helps us print
graphical trees of files and directories.
Usually tree does not come preinstalled
with Linux distributions.
You have to install it using the package manager.
The following is a sample Unix file system tree
to show an example.
The tree command comes with many interesting options.
Let's look at a few of them.
To highlight only files matched by the pattern
use the following syntax.
Pattern should be wildcard.
For example replace path with a directory path.
To highlight only files excluding the match pattern,
to print the size along with files and directories
use the minus h option.
Let's see an interesting option
that is available with the tree command.
Html output for tree.
It's possible to generate an html output
from the tree command.
For example use the following command
to create an html file with a tree output.
Replace http://localhost with the URL
that you are planning to host the file.
Replace path with a real path of the base directory.
For the current directory, use dot as path.
The webpage generated from the directory listing
will look as follows.
In this video we've seen how to print the directory tree.
This video concludes the third section of this course.
We first learned about generating files of any size
and then we moved on to the intersection
and set difference A-B on text files.
After that we have seen about
finding and deleting duplicate files.
Then we moved on to working with file permissions,
ownership and the sticky bit.
Also we've seen how to make files immutable.
Then we've learned how to generate blank files in bulk.
Then we learned about finding symbolic links
and their targets.
Also we have learned how to enumerate file type statistics.
Then we've seen how to use loopback files.
Then we have seen how to create ISO files and hybrid ISO.
We then moved on to the topic,
finding the difference between files and patching.
Then we learned to use head and tail
for printing the last or first 10 lines.
We've also seen listing only directories,
alternative methods,
and then moved on to fast command-line navigation
using pushd and popd.
We then moved on to the topic, counting the number
of lines, words and characters in a file.
Finally we've seen how to print the directory tree.
All the following videos in all of the next sections
we will walk through the many contexts of problems
based on text processing
that will be helpful in writing real scripts.
So the next section will discuss about texting and driving.