Come and get them: tree(s)-1.6.0 and 1.7.0 (32-bit & 64 bit)

Miscellaneous tools
Message
Author
musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

Come and get them: tree(s)-1.6.0 and 1.7.0 (32-bit & 64 bit)

#1 Post by musher0 »

  • -- For the latest 32-bit version as of this writing, please go down here.
    -- You can get step's 64-bit version from this post. Thanks, step.
    -- Thanks to Flash, the history of the < tree > command on this forum is also here
    -- There is some help to get you started using the < tree > command, at the
    __ end of this post, at the top of the next page, and
    here.
~~~~~~~~~~~~~~

Hi folks.

Somebody made me realize that there is no < tree > command in most Puppies.
How PuppyLinux managed without it, I don't know.

[Edit] I'm exaggerating. Please see below Flash's brief history of the < tree >
command on this forum.
[End of edit]

Attached is a tried-and-true version and the basic < tree > help.

Enjoy but be ashamed for Puppy. Yeah, have mixed feelings about it, it's ok.

That anyone has to provide the PuppyLinux community with a separate copy of the
< tree > utility in this forum -- thirteen years after the creation of PuppyLinux -- is
certainly nothing to brag about.

Install < tree > today and be hush-hush about it. Lie about it. Nobody needs to
know. It's a Secret of State: tell your friends Puppy always had it.

[Edit.] According to Flash's findings, it's been available to Puppyists since 2008.
But never widely advertised.
[End of edit]

Geez. BFN.

~~~~~~~~~~~~~~
[~]>tree --help
usage: tree [-acdfghilnpqrstuvxACDFQNSUX] [-H baseHREF] [-T title ] [-L level [-R]]
[-P pattern] [-I pattern] [-o filename] [--version] [--help] [--inodes]
[--device] [--noreport] [--nolinks] [--dirsfirst] [--charset charset]
[--filelimit[=]#] [--si] [--timefmt[=]<f>] [<directory list>]
------- Listing options -------
-a All files are listed.
-d List directories only.
-l Follow symbolic links like directories.
-f Print the full path prefix for each file.
-x Stay on current filesystem only.
-L level Descend only level directories deep.
-R Rerun tree when max dir level reached.
-P pattern List only those files that match the pattern given.
-I pattern Do not list files that match the given pattern.
--noreport Turn off file/directory count at end of tree listing.
--charset X Use charset X for terminal/HTML and indentation line output.
--filelimit # Do not descend dirs with more than # files in them.
--timefmt <f> Print and format time according to the format <f>.
-o filename Output to file instead of stdout.
-------- File options ---------
-q Print non-printable characters as '?'.
-N Print non-printable characters as is.
-Q Quote filenames with double quotes.
-p Print the protections for each file.
-u Displays file owner or UID number.
-g Displays file group owner or GID number.
-s Print the size in bytes of each file.
-h Print the size in a more human readable way.
--si Like -h, but use in SI units (powers of 1000).
-D Print the date of last modification or (-c) status change.
-F Appends '/', '=', '*', '@', '|' or '>' as per ls -F.
--inodes Print inode number of each file.
--device Print device ID number to which each file belongs.
------- Sorting options -------
-v Sort files alphanumerically by version.
-r Sort files in reverse alphanumeric order.
-t Sort files by last modification time.
-c Sort files by last status change time.
-U Leave files unsorted.
--dirsfirst List directories before files (-U disables).
------- Graphics options ------
-i Don't print indentation lines.
-A Print ANSI lines graphic indentation lines.
-S Print with ASCII graphics indentation lines.
-n Turn colorization off always (-C overrides).
-C Turn colorization on always.
------- XML/HTML options -------
-X Prints out an XML representation of the tree.
-H baseHREF Prints out HTML format with baseHREF as top directory.
-T string Replace the default HTML title and H1 header with string.
--nolinks Turn off hyperlinks in HTML output.
---- Miscellaneous options ----
--version Print version and exit.
--help Print usage and this help message and exit.
Attachments
tree-1.6.0.pet
(40.86 KiB) Downloaded 328 times
Last edited by musher0 on Mon 21 Mar 2016, 17:42, edited 10 times in total.
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#2 Post by musher0 »

Sample listing, similar to what you'd get from < ls>.
Attachments
tree_sample-listing_2016-03-18.jpg
(54.13 KiB) Downloaded 726 times
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

User avatar
Flash
Official Dog Handler
Posts: 13071
Joined: Wed 04 May 2005, 16:04
Location: Arizona USA

#3 Post by Flash »

Doesn't work in 64 bit Quirky Werewolf:

Code: Select all

# tree -d
bash: /usr/bin/tree: No such file or directory
# 
Yet there is a file named tree in /usr/bin/ and it is executable. :?

gcmartin

#4 Post by gcmartin »

This seems to be a problem with @BarryK's distros/derivatives. Like you, I have the same problem. But, if we wait I am sure an understanding and solution will emerge before sun-rise, tomorrow. ... maybe sooner!

The TREE command works fine on the WOOFCE PUPs I've tested and on the Lighthouse series of distros, as well; shown here. It gives answers ... fast (similar in performance of the ls command).

Looking forward to tomorrow.
P.S. There is a newer version that just might help. If it does, be sure to update the Thread's title. Maybe just "TREE - a missing Puppy Linux command" or something similar.

gcmartin

Solution for BarryK's derivative.

#5 Post by gcmartin »

This is tested and found working using DLNAPUP!
  1. Use QPM to Uninstall this thread's 1.6 Tree PET.
  2. Use QPM to search for TREE. Then, install the updated TREE version (NO MATTER IFF it has a green checkmark or not!).
  3. Open a terminal and type "tree" to test

    Code: Select all

    bash-4.1# cd /mnt/MyNAS4/ISOs
    <root> /mnt/MyNAS4/ISOs
    bash-4.1# tree -if | grep -E "\.iso$"
    ./Downloads/LInux/Puppy/Musher0/dpw-3.14.56.1.iso
    ./   o
    ./   o
    ./   o
All credit to these steps go to the DLNAPUP distro developer; @ETP!

musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#6 Post by musher0 »

Flash wrote:Doesn't work in 64 bit Quirky Werewolf:

Code: Select all

# tree -d
bash: /usr/bin/tree: No such file or directory
# 
Yet there is a file named tree in /usr/bin/ and it is executable. :?
Hi, Flash.

I compiled this < tree > on a 32 bit. Theoretically a 32-bit app should run on a 64-bit OS.

If it doesn't, well... tough. I won't speculate. It can be for x number of reasons.

BFN.
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#7 Post by musher0 »

@gcmartin:

What is "QPM" ? TIA.
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#8 Post by musher0 »

Hello all.

Here is the latest version as of this writing, tree-1.7.0, upx'd. The changelog is here.

Works fine on 32-bit Puppies and machines, maybe not on 64-bit. In any case,
I compiled it as per the instructions included in the source package. I take no
responsibility if you get a baobab instead of a birch tree on your system.

If you are not satisfied with this compilation, please leave this thread immediately
and go find a < tree > utility compiled by someone else. Or go browse the *tree*
scripts in ocaml at -- https://opam.ocaml.org/packages/index-date.html --.

Do not enjoy, do not pass "Go" and do not collect 200$.

BFN.
Attachments
tree-1.7.0.pet
(42.49 KiB) Downloaded 318 times
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#9 Post by musher0 »

Hello all.

Here's a shell script alternative.
Not as flexible as the original.

BFN.
Last edited by musher0 on Sat 19 Mar 2016, 18:57, edited 1 time in total.
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#10 Post by musher0 »

Hello again, < tree > huggers. ;)

Some resources about < tree >:

Mandatory reading:
Man page for tree

A couple of well done mini-tutorials with illustrations:
http://www.computerhope.com/unix/tree.htm
http://lintut.com/use-tree-command-in-linux

~~~~~~~~~~~~~~~~~
Add'l comments:

As you use < tree >, you'll discover that you can do a lot of listings better, i.e.
more efficiently and more to the point, with < tree > than with < ls >.
("A lot of" does not mean "all". Are we clear on this?)

If you pipe its results through < egrep > (aka < grep -E >) or < awk >, < tree > can
get really powerful while simpler to use than < find >. In many situations, you'll also
get your results faster than by using < find >.
(Again: "many" does not mean "all". Are we clear on this?)

Finally, a "don't-get-confused" warning:
The listings that < tree > provides will overlap with those that < ls > and < find >
provide, but < tree > is not meant to and cannot replace those two utilities.

BFN.
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

gcmartin

#11 Post by gcmartin »

Hello @Musher0. "QPM" you ask: For those who run @BarryK's recent distros,
QPM = Quirky Package Manager. (Sorry for the delay, today)
@Flash is running @BarryK's distro. As I have one of his derivatives running, too.

Tested 1.7.0 on other PUP 32bit distros.

Referencing programs compiled for 32bit will not run correctly in 64bit. Some will and some wont, any more so than a 64bit compiled program will run on 32bit. The source is the same, but compiler and linker outputs are not.

Hope this is helpful.

step
Posts: 1349
Joined: Fri 04 May 2012, 11:20

tree for fatdog64-700

#12 Post by step »

64bit tree for Fatdog64-70x is here
[url=http://murga-linux.com/puppy/viewtopic.php?t=117546]Fatdog64-810[/url]|[url=http://goo.gl/hqZtiB]+Packages[/url]|[url=http://goo.gl/6dbEzT]Kodi[/url]|[url=http://goo.gl/JQC4Vz]gtkmenuplus[/url]

musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

Re: tree for fatdog64-700

#13 Post by musher0 »

step wrote:64bit tree for Fatdog64-70x is here
Thanks.
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

User avatar
Flash
Official Dog Handler
Posts: 13071
Joined: Wed 04 May 2005, 16:04
Location: Arizona USA

Re: tree for fatdog64-700

#14 Post by Flash »

step wrote:64bit tree for Fatdog64-70x is here
Installed in 64 bit Quirky Werewolf by simply clicking on the .txz file and it works just fine. Thanks. :D
For historical purposes, TrailerTrash made the first post featuring tree here.
Pizzasgood compiled tree 1.5.2.2 here and also the .doc file.
Bruce B had an interesting idea for using tree in HTML here.
"tree --help" in a console gets a quick listing, but the options are not well explained. Is there a more complete instruction manual?

musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#15 Post by musher0 »

Hi Flash.

You said:
> "tree --help" in a console gets a quick listing, but the options are not well
__ explained. Is there a more complete instruction manual?


Did you miss this post above? Also, This page on the computerhope site
has examples.

I'll try to come up with more real-life examples below.

BFN.
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#16 Post by musher0 »

Hello all.

As promised:
< tree > command examples using a music collection at /mnt/sda1/Music

First, open a terminal and type < cd /mnt/sda1/Music >
(or wherever your music collection is).
Then do the following exercises to familiarize yourself with the < tree > command.

~~~~~~~~~~~~~~~~~~
Summary

#1 tree (without parameters): outputs all paths and all files with the "tree branches"
< tree >
~~~~~~~~~~~~~~~~~~

#2 tree -d: outputs directories only
< tree -d >
~~~~~~~~~~~~~~~~~~

#3 tree -P parameter. Type
< tree -P '*ogg' >
Gets a listing of paths and files containing "ogg" in them
~~~~~~~~~~~~~~~~~~

#4 tree piped to grep
< tree | grep Vivaldi >
Will give you all paths and files containing the name "Vivaldi" in them.
~~~~~~~~~~~~~~~~~~

#5 tree piped to grep with regex
< tree -if | grep -E "\.ogg$" >

Will give you a listing of files
- ending with the extension ".ogg"
- flush to the left margin,
- with the path
- but without the "tree branches"

Have you noticed the differences between #3, #4 and #5?
The tree command's own "pattern" search (-P "something") is rather crude if you
compare it with piping its results through < grep -E "something" >.
~~~~~~~~~~~~~~~~~~

#6 tree (pseudo-ls listing with "tree branches")

< tree -afhDp >
~~~~~~~~~~~~~~~~~~

#7 tree (pseudo-ls listing without the "branches". Similar to < ls -AlgoR >)

< tree -afhiDp >

Explanation:
-a : all files
-f : full path
-h : human understandable sizes (in Kb's and Mb's rather than only bytes)
-i : no "tree branches". (All files and paths are listed close to the left margin.)
-D : with date
-p : with permissions
~~~~~~~~~~~~~~~~~~

#8 tree -o filename.ext: outputs silently to a text file.

< tree -o ~/tree-P.xmpl -P '*ogg' >
All pathnames and filenames with "ogg" in them will be listed in file
/root/tree-p.xmpl
~~~~~~~~~~~~~~~~~~

#9 tree -H -[some other parameters here]
< tree -o ~/tree-P.html -P '*ogg' -H >
All pathnames and filenames with "ogg" in them will be listed in file
/root/tree-p.html. Similar to #8 above, but in html format, ready to
view in a browser.
~~~~~~~~~~~~~~~~~~
I hope this helps. BFN
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

User avatar
Flash
Official Dog Handler
Posts: 13071
Joined: Wed 04 May 2005, 16:04
Location: Arizona USA

#17 Post by Flash »

musher0 wrote:Hi Flash.

You said:
> "tree --help" in a console gets a quick listing, but the options are not well
__ explained. Is there a more complete instruction manual?


Did you miss this post above? Also, This page on the computerhope site
has examples.

I'll try to come up with more real-life examples below.

BFN.
I didn't miss it, I forgot about it in the excitement of finding a tree that works in 64-bit Werewolf. :oops:

musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#18 Post by musher0 »

@Flash:

No problem! :)

I hope the examples I provided above are clear enough.
If you need more examples, just holler!

BFN.
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

User avatar
Flash
Official Dog Handler
Posts: 13071
Joined: Wed 04 May 2005, 16:04
Location: Arizona USA

#19 Post by Flash »

I'd like to see tree incorporated into ROX-filer's right-click menu. At least, how about a .pet that does that?

User avatar
greengeek
Posts: 5789
Joined: Tue 20 Jul 2010, 09:34
Location: Republic of Novo Zelande

#20 Post by greengeek »

Flash wrote:I'd like to see tree incorporated into ROX-filer's right-click menu. At least, how about a .pet that does that?
I have just used tree for the first time. How would you use it from right click menu?

Would you right click on a directory and select "tree" from the rightclick menu and then have a terminal pop up with the output of the tree command showing the contents of that directory? Is that how you see it working?

Post Reply