0

How can I permanently change PATH variable in Ubuntu 20.04?

What file should I modify?

Thank You

1
  • change or extend?
    – nobody
    Nov 25, 2021 at 20:02

1 Answer 1

2

You can just add it to your ~/.profile or ~/.bashrc or ~/.THESHELLYOUHAVErc

like adding :

export PATH=$PATH:/some-new/:./another

changing might be more like

export PATH=yourneed1/:yourneed2/ 

without the existing one $PATH

but you need to adapt that to your own needs

you have to logout or reload the file source ~/.profile once, it is not instantly done ;) (similar with .bashrc)

3
  • Adding to .profile export PATH=$PATH:/directory , doesn't work. Nov 25, 2021 at 21:08
  • you have to logout or reload the file source ~/.profile it is not instantly done ;) I forgot to comment that.
    – francois P
    Nov 25, 2021 at 21:12
  • Thank you for your answer Nov 25, 2021 at 21:22

Not the answer you're looking for? Browse other questions tagged or ask your own question.