|
|
Display a tree-like structural view of any directory
I just came up with a truly cheesy way to use the output from tree as an interface to the finder. The tree command gives the output as html. If you open an html file in safari (it would be much better to pipe to it, but I can't figure out how), and click the url to a file on disk, it opens a finder window and highlights the file, rather than opening it in safari. I've always found that behavior irritating, but in this case it can be put to advantage.
It is a truly ugly hack, but maybe someone can make it more elegant. cd to your top directory of choice, then issue
The sleep command gives safari some time to open the file before it gets deleted. It would be much nicer to pipe into safari the output of tree than to do this.
Display a tree-like structural view of any directory
You should check out this hint...
Display a tree-like structural view of any directory
This creates a temporary file just as the above does (though it's handled by the open command, so there's not worry about a wait time and having to clean up the file afterward.
Display a tree-like structural view of any directory
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:
---
Display a tree-like structural view of any directory
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.
!!!
tree -H x | sed 's/x\///' ...
ridiculous.
Display a tree-like structural view of any directory
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.
Display a tree-like structural view of any directory
Or even this:
tree -H $PWD > /tmp/$$junk.html ; open /tmp/$$junk.html
|
SearchFrom our Sponsor...Latest Mountain Lion HintsWhat's New:HintsNo new hintsComments last 2 daysLinks last 2 weeksNo recent new linksWhat's New in the Forums?
Hints by TopicNews from Macworld
From Our Sponsors |
|
Copyright © 2014 IDG Consumer & SMB (Privacy Policy) Contact Us All trademarks and copyrights on this page are owned by their respective owners. |
Visit other IDG sites: |
|
|
|
Created this page in 0.09 seconds |
|