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?
1 Answer
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
-
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".– user1686Feb 15, 2012 at 10:36
-
1A 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.– ShadokFeb 15, 2012 at 14:00
~/.local/bin
, etc toPATH
, then similarly~/.local/lib
toLIBRARY_PATH
andLD_LIBRARY_PATH
and then use GNU stow to manage your locally built packages. Done.