1607 shaares
1 lien privé
1 lien privé
TH#
Using .bashrc or .bash_profile#
If you want to add a directory to the PATH permanently for a single user, you can add the export command to the .bashrc or .bash_profile file in your home directory.
Edit the .bashrc or .bash_profile file:
If you are using a Bash shell, you can use a text editor like nano or vim to open the file. For example, to open the .bashrc file with nano:
nano ~/.bashrc
Add the export command: Add the following line at the end of the file:
export PATH=$PATH:/home/user/my_scripts
Save and exit the file:
In nano, press Ctrl + X, then Y, and then Enter to save and exit.
Reload the configuration: To apply the changes immediately, you can source the .bashrc file:
source ~/.bashrc