Page 1 of 1

Tree - shows directory contents in expanded tree format

Posted: Tue 19 Feb 2008, 17:18
by TrailerTrash
[This post copied from here and the off-topic parts of that thread moved to make this thread, by Flash on 8-17-08]
Bruce B wrote:
TrailerTrash wrote: Is there one picture somewhere that shows the entire "tree" and everything in it in plain language.
Yes and no.

There is a tree program which is not included with Puppy. I've attached it to this post.

To install.

Download tree.gz
Navigate to download directory in ROX then
open console and type these commands.

Or open console and navigate to download directory using the cd command. That's how I'd do it.

# gzip -d tree.gz
# mv tree /usr/bin

To learn more about tree's switches and options

# tree --help

(a fairly comprehensive list of options for such a small utility, hope you all enjoy)

Posted: Tue 19 Feb 2008, 20:47
by Flash
Thanks, Bruce, "tree" looks like it might be what I've been searching for to solve a problem. I want the authors and books in my mp3 books directory to show in tree format without my having to click on each author's name, but I don't want the mp3 files to show.

By the way, the program installed as "tree-1" for me. (That's what I had to type in the console to get it to run.) But all is well; I went into /usr/bin and changed the name to "tree" and now it opens when I type tree in a console.

Posted: Wed 20 Feb 2008, 18:32
by Flash
Perhaps I should start a new thread to discuss tree, but I'll stay with this one for now.

Code: Select all

tree -L 2
displays the contents of my mp3 book directory exactly the way I want:
# tree -L 2
.
|-- Arendt, Hannah
| `-- The Origins Of Totalitarianism
|-- Bodansky, Yossef
| `-- Chechen Jihad
|-- Donald, Aida D.
| `-- T.R., Lion in the White House (A)
|-- Dostoyevsky, Fyodor
| `-- Crime and Punishment
|-- Johnson,_Chalmers
| |-- Blowback
| `-- The Sorrows of Empire
|-- Klavan, Andrew
| `-- Damnation Street
|-- Levine, Paul
| `-- The Deep Blue Alibi
|-- McCall, Nathan
| `-- Them (A+)
`-- Short Science Fiction Collection 001
|-- Bread Overhead by Fritz Leiber.mp3
`-- The 4D Doodler by Graph Waldeyer.mp3

18 directories, 2 files
It would be nice if the font was more readable than the one in rxvt. One of the options for tree,
--charset X Use charset X for HTML and indentation line output.
seems to imply that it can display in HTML. I don't have a clue how to use that option in Puppy. What do I enter for X?

Posted: Wed 20 Feb 2008, 20:26
by Eyes-Only
My guess off the top of my head Flash would be like "DejaVu Sans" or maybe even "Sans"?

"Charset" usually means "font", eh? Hence my guesstimate.

HTH?

Eyes-Only
"L'Peau-Rouge"

Posted: Sat 23 Feb 2008, 17:53
by Bruce B
Flash,

Suppose we want an active HTML page of our music directories.

For purpose of illustration, I'll presume our music directories are located under /music (which they probably aren't and you'll have to make adjustments)

# cd /music
# tree -d -H /music > /root/music.html

Using your browser, open /root/music.html. Bookmark it. Thereafter, you can open music.html and click on a directory, the directory will open showing the files within the directory, even though they are not visible in the document music.html.

Clicking on a file will open (or give option to open) that file with the browser's default music player.

Bruce

Posted: Sat 23 Feb 2008, 20:25
by Flash
Bruce B wrote:Flash,

Suppose we want an active HTML page of our music directories.
We do, we do! :)
For purpose of illustration, I'll presume our music directories are located under /music (which they probably aren't and you'll have to make adjustments)

# cd /music
# tree -d -H /music > /root/music.html

Using your browser, open /root/music.html. Bookmark it. Thereafter, you can open music.html and click on a directory, the directory will open showing the files within the directory, even though they are not visible in the document music.html.

Clicking on a file will open (or give option to open) that file with the browser's default music player.

Bruce
Thanks, Bruce. I can't wait to try it. :) (Maybe this weekend I'll find the time.)

Posted: Thu 12 Nov 2009, 03:54
by Flash
Sorry Bruce, your way turned out to be a bit more complex than I needed at the moment. Here's what I did that worked:

Code: Select all

# tree -d -o /tmp/tree_test --charset Fixed --noreport
  • -d makes tree show only the directories, no files.
    -o /tmp/tree_test makes tree put the result in a file named tree_test in /tmp
    -charset Fixed makes tree use the font named Fixed. Turns out that tree will only use fixed spacing fonts, and Puppy only has two: Courier and Fixed. I like Fixed best.
    -noreport makes tree leave off the report at the end which shows the number of directories it found.
I opened the resulting file ( tree_test, in /tmp) in Geany (I tried Abiword but it was way too slow. I guess the file was too big.) and edited it the way I wanted, saved it, then used Menu --> Document --> Puppy PDF to convert it to a pdf file so I could print it.

[Edit: if the commands I used won't work for you, it's probably because the version of Puppy you're using doesn't have the Fixed charset. Just delete " --charset Fixed" from the line.]

Posted: Mon 16 Aug 2010, 04:25
by Flash
Attempt to use Tree (from the first post in this thread) in Quirky 1.0 gives this error message:

Code: Select all

# tree -d -o /tmp/tree_test --charset Fixed --noreport
tree: Invalid argument -`'.
usage: tree [-adfgilnpqrstuxACDFNS] [-H baseHREF] [-T title ] [-L level [-R]]
#

I opened a xterm window in the directory by hitting the ` key while in the directory. Thinking that was the problem, I opened a xterm window by right-clicking in the directory and choosing Window, then Terminal here. Either way gave the same result.

Edit: Pizzasgood's Tree 1.5.2.2 .pet works in Quirky 1.3

Posted: Tue 17 May 2011, 08:31
by cthisbear
I used ZTreeWin for years...Windows.

I don't know if it runs in wine.

http://www.ztree.com/html/ztreewin.htm

My knowledge of computers started by using XTreeGold
and Quikmenu.

http://www.download-central.ws/DOS/Apps/Q/QuikMenu/

Mary Hopkins moment there.

http://www.youtube.com/watch?v=MDVhB0jG ... re=related

Chris.