To add the example_file path to the environmental variable, I did the following:
$ gedit ~/.bashrc
and add the following code at the end of the file
export PATH=~/example_file/lib/
$ source ~/.bashrc
The tragedy happend!!!
The command could not be located because `/usr/bin` is not included in the
PATH environment variable. clear: command not found
Then I realized that I incorrectly changed the PATH, so common commands such as ls
, find
, and even ‘vi’ did work. I can only modify files with the full absolute path.
$ /usr/bin/gedit ~/.bashrc
Add the command like this:
export PATH=~/example_file/lib/:/$PATH
Restart the terminal, it works!