filmov
tv
How to Add A Directory to $PATH in Linux

Показать описание
For temporary user, run command in terminal:
export PATH=/Path/To/Folder:$PATH
For permanent, either edit "/etc/profile" for global or:
one of "~/.bash_profile", "~/.bash_login", "~/.profile" that exist in your Linux.
or "~/.bashrc" that works in most Linux..
And use 'if' statement for choice to avoid 'No such file or directory':
if [ -d "/Path/To/Folder" ] ; then
PATH="Path/To/Folder:$PATH"
fi
export PATH=/Path/To/Folder:$PATH
For permanent, either edit "/etc/profile" for global or:
one of "~/.bash_profile", "~/.bash_login", "~/.profile" that exist in your Linux.
or "~/.bashrc" that works in most Linux..
And use 'if' statement for choice to avoid 'No such file or directory':
if [ -d "/Path/To/Folder" ] ; then
PATH="Path/To/Folder:$PATH"
fi