Apologies if this duplicate but a lot of other threads are years old.
I want to update my $PATH variable permanently so it doesn't reset everytime I quit Terminal. I have seen people suggest to run the following:
gedit ~/.bashrc
But this returns:
-bash: gedit: command not found
I have used Spotlight to search my hard disk for the .bashrc file and can't find it. Can anyone help?
Thanks in advance...
You don't need an editor for that, you can do this using bash's output redirection operation.
For example, to add /foo/bar you current PATH, append (>>) to ~/.bashrc:
echo 'export PATH="$PATH":/foo/bar' >> ~/.bashrc
To view the content to STDOUT too, use tee -a:
echo 'export PATH="$PATH":/foo/bar' | tee -a ~/.bashrc
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With