We need to add the directory where the executable file is located to the PATH environment variable.
-
1
sudo vim/etc/profile add a line: export PATH=$PATH:/script directory/
remember to source and load the profile.
There is a little problem with this: the colors on the command line are all gone -
2
sudo vim /etc/environment, add the directory to the back of the PATH. I used this
and remember to source and load the profile
*3
Put the executable file directly into /usr/bin or /usr/local/bin, because these files are already in the PATH