I know similar questions have been asked before on here (for example: How to add a directory to the PATH?)
However, I don't know what to add and where to add this.
If I open ~/.profile
, it looks like this:
# if running bash
if [ -n "$BASH_VERSION" ]; then
# include .bashrc if it exists
if [ -f "$HOME/.bashrc" ]; then
. "$HOME/.bashrc"
fi
fi
# set PATH so it includes user's private bin directories
PATH="$HOME/bin:$HOME/.local/bin:$PATH"
Now I want to add a directory to this
/home/newsof/mypackage/TT/V1_1
How can I add this permanently?
~/.profile
sayingPATH=$PATH:/home/newsof/mypackage/TT/V1_1
– Zanna Mar 03 '17 at 22:23source ~/.profile
It's permanent – Zanna Mar 03 '17 at 22:30export
ing isn't necessary in this case is thatPATH
already exists as an environment variable. It's not related to temporary vs. persistent. – Gunnar Hjalmarsson Mar 03 '17 at 22:33FOO=bar ; FOO=$FOO:bar ; echo $FOO
I will getbar:bar
– Zanna Mar 03 '17 at 22:41