At the command line terminal input: Echo $PATH Enter to print out the path corresponding to the paths variable
An existing executable file QTFIRSTC, the directory where the file is:/HOME/LOLORS/QTFIRSTC
Now test can only run in this directory, how to run across terminals or directories, like LS, CD and other commands?
Workaround:
1. Cross-directory, not across the terminal, temporary effect: the operation, that is, add temporary environment variables, can only be used under this terminal, only for the current user to take effect.
2. Both cross-directory, and cross-terminal, permanent effect:
1). Modify the directory under the/etc/profile file, add the last line: Export path= $PATH:/HOME/LOLORS/QTFIRSTC, save exit, take effect for all users.
At this time the file is not in effect, in order to take effect can restart the system, after reboot for all the terminal, all users take effect.
2). It is also a permanent method, but this time the modified file is/etc/environment, modified to save. After rebooting, all users are in effect for all terminals.
3) Permanent, the current user takes effect, do not need to restart the system to take effect.
Modify/HOME/LOLORS/.BASHRC file: Add a line at the end of the file: Export path= $PATH:/HOME/LOLORS/QTFIRSTC
Effective method: ① re-open the terminal,
③source/home/lolors/.bashrc
Linux system executables Add environment variables to make them run across terminals and directories