Show how you can add /home/<yourusername>/bin to the $PATH variable. Use $HOME (or ~) to
represent your home directory.
Asked
Active
Viewed 2.4e+01k times
54
muru
- 207,228
user233233
- 733
2 Answers
75
To do that you need to type in your terminal:
export PATH="$HOME/bin:$PATH"
This change is only temporary (it works only in the current session of the shell). To make it permanent, add the line to your .bashrc file located in your home directory.
wxl
- 1,026
Swordfish90
- 978
42
Ubuntu (and Debian based distros) automatically add $HOME/bin to the PATH if that directory is present. You can check this in ~/.profile:
# set PATH so it includes user's private bin if it exists
if [ -d "$HOME/bin" ] ; then
PATH="$HOME/bin:$PATH"
fi
falconer
- 15,334