Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'Display a tree-like structural view of any directory' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Display a tree-like structural view of any directory
Authored by: GlowingApple on Feb 15, '06 08:30:13PM
I couldn't get the perl command to work. The top of the tree shows rmtag as the text still. I'm guessing the / after the rmtag is a typo? In any case, I would prefer to have the top of the tree list the full path of the directory in which tree is working:
tree -H rmtag | perl -p -e "s|rmtag|`pwd`|g" >| junk.html ; \
open junk.html ; sleep 6 ; /bin/rm -f junk.html

---
Jayson --When Microsoft asks you, "Where do you want to go today?" tell them "Apple."

[ Reply to This | # ]

Display a tree-like structural view of any directory
Authored by: ra5ul on Feb 15, '06 10:02:03PM
there's just a backslash missing:
tree -H x | sed 's/x\///' ...

you can get this to work in elinks (any probably other text browsers) with:
tree -aH `pwd` | elinks -force-html

as for safari, it doesn't always open local files in the finder (e.g. *.js, *.pl, *.py open fine on 2.0.3). it seems to be restricted to directories and files it would normally download instead of displaying. there should be a way to specify these files (either in safari's Info.plist or through launchservices), but i don't know how.

[ Reply to This | # ]

!!!
Authored by: ra5ul on Feb 15, '06 10:05:34PM
tree -H x | sed 's/x\///' ... ridiculous.

[ Reply to This | # ]
Display a tree-like structural view of any directory
Authored by: wgscott on Feb 15, '06 10:05:44PM
That actually makes it cleaner. Just do this:

tree -H $PWD > junk.html ; open junk.html ; sleep 6 ; /bin/rm -f junk.html

The other was just designed to trim the ./ from the front of the path. This instead appends the true full path, so it is unambiguous as well as much cleaner. Now if only I could pipe it.

[ Reply to This | # ]
Display a tree-like structural view of any directory
Authored by: wgscott on Feb 15, '06 10:09:08PM
Or even this:

tree -H $PWD > /tmp/$$junk.html ; open /tmp/$$junk.html

[ Reply to This | # ]