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.
Pergunta
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?
Solução
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.
Outras dicas
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
I'm running Linux Mint 18.3 Cinnamon. The changes in file ~/.profile got picked up only after I logged out/in from the account. The terminal restart was not enough in my case.
If you edit the .bashrc file,
vim ~/.bashrc
you will see the next line
# Alias definitions.
# You may want to put all your additions into a separate file like
# ~/.bash_aliases, instead of adding them here directly.
# See /usr/share/doc/bash-doc/examples in the bash-doc package.
if [ -f ~/.bash_aliases ]; then
. ~/.bash_aliases
fi
So create a ~/.bash_aliases file in your $HOME folder and add any command you want to be executed when you open the terminal.
You may add an entry to the ~/.pam_environment file.
Use any editor to access the file. I am using the default Linux Mint Text Editor (xed).
xed ~/.pam_environment
That file is likely to have some entries already. Add a new line to the file and add your entry. For example, I am adding a java binary path which is in the opt folder to the $PATH environment variable:
PATH DEFAULT=${PATH}:/opt/JDK11/jdk-11.0.2/bin`
Or if you want to add a path that is in the user home or something like that, then do like:
PATH DEFAULT=${PATH}:/home/@{PAM_USER}/MyPrograms`
Save the file. It should work. If it doesn't, log out, log back in and try again. If it doesn't work even after that, then restart and try again and it will work for sure. :)