Tree - shows directory contents in expanded tree format

Filemanagers, partitioning tools, etc.
Post Reply
Message
Author
User avatar
TrailerTrash
Posts: 67
Joined: Tue 29 Jan 2008, 16:50

Tree - shows directory contents in expanded tree format

#1 Post 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)
Attachments
tree.gz
(15.17 KiB) Downloaded 1217 times

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

#2 Post 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.
[url=http://www.murga-linux.com/puppy/viewtopic.php?t=69321][color=blue]Puppy Help 101 - an interactive tutorial for Lupu 5.25[/color][/url]

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

#3 Post 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?

User avatar
Eyes-Only
Posts: 1043
Joined: Thu 10 Aug 2006, 06:32
Location: La Confederation Abenaquaise

#4 Post 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"
*~*~*~*~*~*
Proud user of LXpup and 3-Headed Dog. 8)
*~*~*~*~*~*

Bruce B

#5 Post 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

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

#6 Post 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.)

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

#7 Post 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.]

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

#8 Post 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

cthisbear
Posts: 4422
Joined: Sun 29 Jan 2006, 22:07
Location: Sydney Australia

#9 Post 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.

Post Reply