Linux Instructions Tips

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.