1. Invoke the command using the app name to avoid the path.
For example, in the path/usr/local/mobile/php538 built a PHP application, when invoking the PHP command, we need to add a path to access such as/USR/LOCAL/MOBILE/PHP538/BIN/PHP-V, if you want to avoid the path of the
A. Use link to create a soft link.
[Email protected] bin]#Echo$PATH/sbin:/bin:/usr/sbin:/usr/Bin[[email protected] bin]# CD/sbin/[email protected] sbin]# link/usr/local/sina_mobile/php538/bin/php php538link:cannot Create link ' php538'To '/usr/local/sina_mobile/php538/bin/php': Invalid cross-device Link[[email protected] sbin]# CD/usr/sbin/[email protected] sbin]#lsphp538 php538[[email protected] sbin]#RM-f php538 [[email protected] sbin]# link/usr/local/sina_mobile/php538/bin/php php538[[email protected] sbin]#lsphp538 php538[[email protected] sbin]# php538-vphp5.3.8(CLI) (Built:jun - the -: -:xx) Copyright (c)1997- .The PHP groupzend Engine v2.3.0, Copyright (c)1998- .Zend Technologies
B. Use export to modify the PATH environment variable.
Exports modifying an environment variable is only a temporary modification, and when the user login is logged in, the environment variable that was last logged in modifies is invalidated.
[Email protected] yebin]#Echo$PATH/sbin:/bin:/usr/sbin:/usr/Bin[[email protected] yebin]# export PATH="/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sina_mobile/php538/bin"[[email protected] yebin]# PHP-vphp5.3.8(CLI) (Built:jun - the -: -:xx) Copyright (c)1997- .The PHP groupzend Engine v2.3.0, Copyright (c)1998- .Zend technologies[[email protected] yebin]# exitexit# re-login [[email protected] yebin]# PHP-Vbash:php:command not found
C, modify the profile file and the . BASHRC file, but will be permanently active after rebooting the system
Added export path= "$PATH:/usr/local/sina_mobile/php538/bin" when modified
Linux Instructions Tips