You can change your PATH by editing your ~/.bash_profile file or ~/.profile file under Linux operating systems for your own login session. Open a command-line terminal (select Applications > Accessories > Terminal), and then type the following commands to edit ~/.bash_profile file:
To add /opt/apps and $HOME/bin/ directories to your PATH, append or modify the line starting with PATH:
vi ~/.bash_profile
The ":" act as a separator to represent a list of directories. Save and close the file. Logout and login back to see your new path settings:
export PATH=$PATH:/opt/apps:$HOME/bin
echo $PATH
Change the PATH For All Users On Linux
You can change the PATH for all users on the Linux system by editing the file /etc/profile file, enter:# vi /etc/profile
To add /opt/apps directory to your PATH, append or modify the line starting with PATH as follows:
Save and close the file.
export PATH=$PATH:/opt/apps
No comments:
Post a Comment