How can I add my own directory to PATH without editing my local profile's .bash_profile or .bashrc?
I need to make the scripts in the directory universally accessible from any user that is logged in.
To add a path to the PATH environment variableIn the System dialog box, click Advanced system settings. On the Advanced tab of the System Properties dialog box, click Environment Variables. In the System Variables box of the Environment Variables dialog box, scroll to Path and select it.
Permanently add a directory to $PATHbashrc file of the user you want to change. Use nano or your favorite text editor to open the file, stored in the home directory. At the end of this file, put your new directory that you wish to permanently add to $PATH. Save your changes and exit the file.
You should modify the file /etc/environment.
You could add the following in /etc/bashrc
export PATH="$PATH:/your/directory"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With