I was trying to modify the ~/.profile file to add a line to the PATH variable. I added this line:
PATH=$PATH:/home/paul/avatar-gf-1.0-ea/glassfish4/bin/
at the end. I restarted the terminal, but it still did not identify commands in that directory. Does anyone know what I am doing wrong?
To make permanent changes to the environment variables for all new accounts, go to your /etc/skel files, such as . bashrc , and change the ones that are already there or enter the new ones. When you create new users, these /etc/skel files will be copied to the new user's home directory.
How do I set global environment variables in Linux Mint? Set them in /etc/profile . When Bash is invoked as an interactive login shell, or as a non-interactive shell with the --login option, it first reads and executes commands from the file /etc/profile , if that file exists. After reading that file, it looks for ~/.
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.
Try this in the ~/.pam_environment in your home folder. If it does not exist then create it:
PATH DEFAULT=${PATH}:/home/paul/avatar-gf-1.0-ea/glassfish4/bin/
You will need to log in and out.
Run bash -xl
to see which startup files are loaded with your shell. .profile
may actually not be read. Otherwise try adding export
to your assignment:
export PATH=$PATH:/home/paul/avatar-gf-1.0-ea/glassfish4/bin/
Reference about Bash's startup files: Bash Startup Files
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