Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I would like to download and install (compile) gnu tree on linux machine with no root access, but Googling GNU tree doesn't even give me a page where to download it to. Anyone?

share|improve this question

1 Answer 1

up vote 2 down vote accepted

Here is the official website and the latest sources: http://mama.indstate.edu/users/ice/tree/

Rather than compiling tree you may want to have a look at this one-liner in shellscript:

ls -R | grep ":$" | sed -e 's/:$//' -e 's/[^-][^\/]*\//--/g' -e 's/^/   /' -e 's/-/|/' 

Not as clean as tree but good enough for the majority of cases !

For another implementation of tree in bash the guy made a good script here: http://mama.indstate.edu/users/ice/bash/btree

share|improve this answer
    
The problems with such one-liners are, as you have noted yourself, that 1) they are not as clean as tree and 2) they are only "good enough" for the "majority". –  grawity Feb 15 '12 at 10:36
    
A machine without root access is "good enough" too for the majority, we are not talking about an edge case here but a specific one. Moreover when you are down to compiling your tools on a machine you're not root on you may be interested in quicker solution as a bash script ; installing a compiler and resolving dependencies isn't that fun just to display a tree representation of some folders. –  Shadok Feb 15 '12 at 14:00

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.