Episode: 1719
Title: HPR1719: The Linux Tree Command
Source: https://hub.hackerpublicradio.org/ccdn.php?filename=/eps/hpr1719/hpr1719.mp3
Transcribed: 2025-10-18 08:12:11

---

This is HPR episode 1,719 and titled The Linux Tree Command.
It is hosted by JWP and is about 14 minutes long.
The summary is The Linux Tree Command and its uses.
This episode of HPR is brought to you by an honesthost.com.
Get 15% discount on all shared hosting with the offer code HPR15.
That's HPR15.
Better web hosting that's honest and fair at An honesthost.com.
Good day and welcome to this edition of Hacker Public Radio.
My name is JWP and I am doing a podcast today about The Linux Command Tree.
How did it come about?
I am studying for my Linux Incinels certification from the LPI thing.
They have the first thing, the Linux Incinels, and then you do the LPIC-1 and LPIC-2, and then there's the LPIC-3.
If you do the LPIC-1, they have a little starter in all the Linux Incinels.
I got the book and you can download the book.
It's free. It's a PDF.
There's another one also that's free that I've been using.
So I didn't buy the Linux Incinels book.
I did find on Amazon's two used LPIC-1 and 2 books, one from O'Reilly,
that I saw new at Fostam, but when I got on Amazon, it was just a few dollars.
So I was going through and doing the different things.
And then one of the free PDFs that mentioned the Tree Command.
And I never had used the Tree Command before.
So if you're using Ubuntu, you have to do sudo, apt, minus, git, space, install,
and then Tree, and then it'll install a really small file.
And you type Tree in the directory that you are, and a colored listing comes up.
And it's pretty helpful because you can see the different directories,
and then you can use the scroll bar to go back up and down and get what you're doing.
And so what was useful to me was that they've been using a word a lot
in my study and for this Linux Incinels thing called recursive, recursive,
or recursively. And I didn't know what it meant.
And even after going to Dictionary Comm, it was pretty hard.
So I had to go to the Merion Dictionary and finally I got a little better.
So if it says something, it's recursive. It's a pertaining to
or using a rule or procedure that can be applied repeatedly.
So I always thought recursively meant that it would be like
in first or the first last or something.
But no, it's just something that can be done repeatedly.
And then in mathematics or computers pertaining to or using the mathematical process of recursion.
And so I had to look up what recursion was.
And so the first definition from Merion was to return.
And then the second one, it was the determination of a succession of elements
as numbers are functions by operation on one or more proceeding elements,
according to the rule or formula, involving a finite number of steps.
Okay. And so that's the definition of recursion.
And the tree is a recursive directory listing program.
So I guess it has some steps that it does every time
that produces a death-ending listing with no arguments.
Tree lists the files and the current directory.
With directory arguments, they're given to tree lists all the files and
directories found in a given directory in each turn.
Upon the completion of the listing of the directories found,
tree returns a total number of files and directories listed.
Okay. Now the interesting, you know, why you just wouldn't use LS or something
is that there's, it's a really colorful thing.
So you can better see it than with the LS command.
I don't know, you can go in and set the LS up to do whatever colors you want.
But this does a listing of files is colorized,
a lot, DRR colors.
If the LS colors environment variable is set to,
and the output is to TTY.
So it's, for me, it was very colorful.
And both my Red Hat Enterprise Workstation
and in my Ubuntu 12x4.
So they both worked and they both had to be installed
from the, they both had to be installed.
Okay. So some of the options, okay.
So of course, with tree, you can do a tree,
space, hyphen, hyphen, help.
And it gives a robust usage listing.
The version is next.
So again, help, space, hyphen, hyphen, version shows the version.
Minus A, all files are printed.
But a fault, the tree does not print in file.
So it's just like LS if you use the minus A option.
The minus D is for directories only.
F prints the full path prefix for each line.
I makes the tree not print the indentation lines.
And it's useful when used in the conduction with F.
So, and then they have the L follows any symbolic links that you have
in the directories.
The X tells it to stay in the current file system only.
And it uses the thing a law find minus X TV.
And P is for a pattern.
And it gives a lot of things about wild cards and searches.
And it looks like the standard, the same thing that you can do with LS.
You can do a tree in that description.
The I pattern doesn't do not list the files.
And so then they have a little P.
A little minus P is a print, a file type permissions for each file.
And it's the same thing as LS minus L.
And minus S is print the size of each file along with a name.
And then minus H is print the size of each file in a more human readable way.
And G is print the group name or grid number.
If no group name is available on the file.
Okay. And then capital D is print the last notification time for the listed file.
And then they have in nodes,
hyphen hyphen in nodes, prints in nodes of the directory.
And then hyphen hyphen device,
printed device for directory hyphen capital F is the append.
For directories or sockets, Q is hyphen small case Q is print a non-printable
characters and follow names as question marks.
Capital N is print non-printable characters as inserted in the default
carrot notification.
You can sort the output by version with hyphen lowercase V.
R, you can sort the output in reverse order.
T is sort the argument by manufacturing.
T is sort the output by last modification instead of alphabetically.
And list the directories are hyphen DIRS first listed directories before the file names.
Hyphen lowercase N turns the colorization off always.
It's overwritten by the capital C option.
Turn off turn colorization always on is built into the color to fault with LLS colors.
Again, when I typed in the tree command, it was much it popped a lot more than when I used the LS command.
Minus capital A is turn on ASCII line graphics.
And then capital A hyphen capital S is turn on ASCII graphics.
Useful when using the console mode fonts.
And it talks about IBM character set 3 or 437.
There's a lot more of these things, but it's not really that interesting.
Where you can configure the colors is an Etsy slash capital DIR underscore colors.
And that can be defined.
And also in your environment under LLS colors tree character set and LCC type.
Okay, the person that wrote this is Steve Baker.
And he looks to be from Indiana State University.
And the guy that did the HTML output was a guy named Francis Roker from college.
It looked like in Spain.
And another guy from Japan, Karuto Turokou, he did the character sets for OS2.
All right, hey, this concludes the podcast.
I hope you all had a great, great time listening to me and the tree command.
If you don't need to get in touch with me, it's JWP5 at hotmail.com.
You'll have a great, great day.
You've been listening to Hecker Public Radio at Hecker Public Radio dot org.
We are a community podcast network that release the shows every weekday, Monday through Friday.
Today's show, like all our shows, was contributed by an HPR listener like yourself.
If you ever thought of recording a podcast and click on our contributing to find out how easy it really is.
Hecker Public Radio was founded by the digital dog pound and the infonomicon computer club.
And it's part of the binary revolution at binwreff.com.
If you have comments on today's show, please email the host directly.
Leave a comment on the website or record a follow-up episode yourself.
Unless otherwise status, today's show is released on the create of comments,
attribution, share light, free dot org license.
