Created
February 19, 2018 03:03
-
-
Save dalgu90/4c2b3dd68e6fe84c1f5017775019de78 to your computer and use it in GitHub Desktop.
Install linux tree command on local path
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
PREFIX="$HOME/.local/" | |
install_tree() { | |
# The project page of linux "tree" command is located at http://mama.indstate.edu/users/ice/tree | |
TMP_TREE_DIR="/tmp/$USER/tree"; mkdir -p $TMP_TREE_DIR | |
wget -nc -O $TMP_TREE_DIR/tree.tgz "http://mama.indstate.edu/users/ice/tree/src/tree-1.7.0.tgz" | |
tar -xvzf $TMP_TREE_DIR/tree.tgz -C $TMP_TREE_DIR --strip-components 1 | |
cd $TMP_TREE_DIR | |
make | |
mkdir -p "$PREFIX/bin" | |
mv -v tree "$PREFIX/bin" | |
# Maybe $PREFIX/bin was added to $PATH, if you run the wookayin/dotfiles script | |
# echo "export PATH=$PREFIX/bin:$PATH" | |
} | |
install_tree |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks!
It helped me to install tree without super user permissions.