Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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
No root access: just export an user directory such as ~/.local/bin, etc to PATH, then similarly ~/.local/lib to LIBRARY_PATH and LD_LIBRARY_PATH and then use GNU stow to manage your locally built packages. Done. – dmvianna Feb 10 at 5:43
up vote 5 down vote accepted

Here is the official website and the latest sources:

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:

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


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.