Add variable Path global


I’m trying to add a variable in my PATH. I used this command :

export PATH=$PATH:/home/USERNAME/.local/share/gem/ruby/3.0.0/bin

This work but if I open a new terminal, the variable doesn’t work again. How it’s possible to add a variable globally on the system ?


Since it references your user’s home directory, it’s probably not a good idea to add it globally to the PATH. You could put it in the .bashrc/.zshrc file, though.

This should help.

Thank you, I’ve added my command in these files and it’s work perfectly !

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.