Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

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'm connected to a Linux box through SSH on which I don't have administrative privileges. The command I wish to use is called tree, but it isn't installed.

Is there any way I can load the tree program into my home directory and run it without the need to install it system wide?

share|improve this question
up vote 1 down vote accepted

tree doesn't seem to have particular dependencies (libc6) so I guess you can simply copy the executable (located in which tree on another system with tree installed or alternatively you can compile it from source, here's the home page of the project) in a directory on the Linux box which you're connected, say ~/bin/, then you just need to update your $PATH environment variable to add that directory.

If you're using Bash put this in your ~/.bashrc:


Note: Be sure to match architecture and OS.

share|improve this answer
I can tell it's running linux by calling "echo $(uname)", but how do I figure out the architecture? – Corey T Foote Sep 19 '10 at 23:26
Show me the output of uname -m. – cYrus Sep 19 '10 at 23:33
That gives you the machine hardware name (e.g. x86_64, i686, ...). – cYrus Sep 19 '10 at 23:42
@Corey: echo is unnecessary. uname (and most others) do their own output. – Dennis Williamson Sep 19 '10 at 23:47

You would usually build and install it on the prefix $HOME. That means the binary would go into $HOME/bin, libraries into $HOME/lib and so on. Then you insure that these directories appear on $PATH, $LD_LIBRARY_PATH, $MAN_PATH, etc (usualy by editting your shell startup files) and it will work transparently.

Here's a recipe that will work with many programs

$ cd $HOME
$ mkdir src
$ cd src
$ wget
$ tar xzfv program.tgz
$ cd program
$ ./configure --PREFIX=$HOME
$ make
$ make install

Note that unlike installing on /usr/local there is never any need for root privilege.

share|improve this answer
I suggest putting stuff in $HOME/local/ to keep the root folder a bit tidier. – user31752 Sep 20 '10 at 1:22
@mankoff: I never thought of that. I've simple stopped seeing those directories. – dmckee Sep 20 '10 at 21:54

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .