On Fri, Jun 24, 2022 at 9:09 AM Anil F Duggirala <anilduggir...@fastmail.fm> wrote:
> hello, > I would like to change the $PATH environment variable permanently, to > be able to execute a program more quickly. > I have tried adding a new line: export PATH=$PATH:/my/path , to my > .bashrc . > When I log in again, I see that $PATH is now: $PATH:/my/path/:/my/path, > my directory has been appended twice. > I don't know exactly what the "export" command actually does, so I am > lost here. > I expect many other command-line tools are also unknown to you. Adjusting the PATH setting may not be the best solution if you just want to run one program. You can add your program to the GUI configuration to start it with an icon, put a symbolic link to the program in a directory that is already in the PATH, such as $HOME/bin, create a shell script that runs the program with additional environment settings, and many more depending on how the program is used. Once your linux usage moves beyond web browsing it is important to master some basic command-line/shell tools. There are many dangerously misleading youtube tutorials (avoid those that claim to be easy or fast!) and a few that are excellent, but I suggest starting with LinuxCommand.org as it has been used by many people for years. If the directory you want to add to the PATH contains a single program, other methods are probably more appropriate. The reason the PATH is added twice is that ~/.bashrc gets run each time bash is invoked. If you log in on a text console you normally see one entry in the PATH. If you are in a bash terminal session and see 2 entries, starting bash again will give 3 entries. On Fedora, /etc/profile defines a shell function called pathmunge that checks to see if a directory is already in the PATH before adding it to the PATH. > thanks for your help. > -- George N. White III
_______________________________________________ users mailing list -- users@lists.fedoraproject.org To unsubscribe send an email to users-le...@lists.fedoraproject.org Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/ List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines List Archives: https://lists.fedoraproject.org/archives/list/users@lists.fedoraproject.org Do not reply to spam on the list, report it: https://pagure.io/fedora-infrastructure