How do I add /new/dir to the PATH variable such that it will look for executables in that directory before any others and how do I make that change permanent in my bash shell?
How do I add /new/dir to the PATH variable such that it will look for executables in that directory before any others and how do I make that change permanent in my bash shell?
There are two main ways to add /new/dir to the beginning of your PATH permanently: 1. Edit your ~/.bashrc file:
1 2 | echo 'export PATH="/new/dir:$PATH"' >> ~/.bashrc source ~/.bashrc |
1 2 | echo 'export PATH="/new/dir:$PATH"' >> ~/.bash_profile source ~/.bash_profile |
1 | echo $PATH |
Testing if the previous output contains the string source ~/.bashrc
: True
Testing if the previous output contains the string export PATH=/new/dir:$PATH
: False
How do I add /new/dir to the PATH variable such that it will look for executables in that directory before any others and how do I make that change permanent in my bash shell?
How do I add /new/dir to the PATH variable such that it will look for executables in that directory before any others and how do I make that change permanent in my bash shell?
There are two main ways to add /new/dir to the beginning of your PATH: 1. For the current session only:
1 | export PATH="/new/dir:$PATH" |
1 | echo 'export PATH="/new/dir:$PATH"' >> ~/.bashrc |
1 | source ~/.bashrc |
Testing if the previous output contains the string source ~/.bashrc
: True
Testing if the previous output contains the string export PATH=/new/dir:$PATH
: False
How do I add /new/dir to the PATH variable such that it will look for executables in that directory before any others and how do I make that change permanent in my bash shell?
How do I add /new/dir to the PATH variable such that it will look for executables in that directory before any others and how do I make that change permanent in my bash shell?
There are two ways to add /new/dir to the beginning of the PATH variable: Temporary (current session only):
1 | export PATH=/new/dir:$PATH |
1 | nano ~/.bashrc
|
1 | export PATH=/new/dir:$PATH |
1 | source ~/.bashrc |
Testing if the previous output contains the string source ~/.bashrc
: True
Testing if the previous output contains the string export PATH=/new/dir:$PATH
: True
How do I add /new/dir to the PATH variable such that it will look for executables in that directory before any others and how do I make that change permanent in my bash shell?
How do I add /new/dir to the PATH variable such that it will look for executables in that directory before any others and how do I make that change permanent in my bash shell?
There are two ways to add /new/dir to the beginning of your PATH: Temporary (current session only):
1 | export PATH="/new/dir:$PATH" |
1 | nano ~/.bashrc
|
1 | export PATH="/new/dir:$PATH" |
1 | source ~/.bashrc |
1 | echo $PATH |
Testing if the previous output contains the string source ~/.bashrc
: True
Testing if the previous output contains the string export PATH=/new/dir:$PATH
: False
How do I add /new/dir to the PATH variable such that it will look for executables in that directory before any others and how do I make that change permanent in my bash shell?
How do I add /new/dir to the PATH variable such that it will look for executables in that directory before any others and how do I make that change permanent in my bash shell?
There are two ways to add /new/dir to the beginning of your PATH: Temporary (current session only):
1 | export PATH="/new/dir:$PATH" |
1 | nano ~/.bashrc
|
1 | export PATH="/new/dir:$PATH" |
1 | source ~/.bashrc |
Testing if the previous output contains the string source ~/.bashrc
: True
Testing if the previous output contains the string export PATH=/new/dir:$PATH
: False