If you make a bin directory in your home directory, you don't actually need to do anything
One thing Debian (and it's derivatives) do is look for a bin directory in your home directory, and add it to the path automatically
see ~/.profile
Code:
# set PATH so it includes user's private bin if it exists
if [ -d "$HOME/bin" ] ; then
PATH="$HOME/bin:$PATH"
fi
Btw,
when looking through the path variable for a program's location, the shell will take the first one it comes across
So, your path variable will look like
/home/user/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games
The search goes in order, left to right
so if you had a program called "foo" in /home/user/bin, and another (different) program called "foo" in /usr/local/bin
typing "foo" would execute the one in /home/user/bin
This means you can easily override programs with altered local versions, if you wish
make a program called "ls" in your ~/bin dir, and it'll always override the system installed ls command, unless you specify the absolute path of ls
Bookmarks