The best way to extend $PATH

Hy, gays!

I want to extend $PATH variable
for exsample: PATH=$PATH:/home/user/myfolder

In which file is the best way to add this line?

Hi and welcome to the forum! :smiley: We hope you enjoy your stay here

If you use zsh, add this to the bottom of ~/.zshrc :

export PATH="$PATH:/home/user/myfolder

Tnx, @TheTechRobo!
This is exactly what I was looking for

Any time! Do remember that you're always welcome here, for questions, concerns, and suggestions. :slight_smile:

BTW there's a powerful way to extend the PATH in a dynamic way thanks to zsh and the configurations of Elive, check these next lines as an example :slight_smile:

is that not the same as putting it in ~/.zshrc???

well that would make it available system wide whereas ~/zsh.rc or bash.rc would only be the user in who's $HOME it is.

ah, thanks for clearing that up for me.

Well, I put that code just as an example, in fact this code is meant to support PATH in a dynamic way (if you are in the group of games, you will have games in your path, etc...) the idea is to support the main things automatically :slight_smile:

about the user's home zshrc, yes you should put it in your users home, not in the system one... the system one is the one used and then the user's one is get after it (so you can add more things, or overwrite / delete others)