For a temporary solution or for current terminal session we can use the export command to do this. Here in the below example am adding the directory /usr/local/bin to path environment variable.
# export PATH=$PATH:/usr/local/bin
For a more permanent solution we can add this to
If you don't know how to edit and add in
~/.bashrc file , you can just execute this line in a Terminal which will do the thing for you.
echo "PATH=\$PATH:/usr/local/bin" >> ~/.bashrc
To crossverify if the above command worked succefuly we can use the below command and check if the path is set correctly.
We should see our directory path as below.