MAC OS X Configuration environment variables

Source: Internet
Author: User

/ETC/PROFILE;/ETC/BASHRC is a global variable for all users of the system, and only the root user can modify the two files, which is read-only to the average user. General users to modify them, you can add sudo before the command, meaning to execute as root, such as: sudo vi/etc/profile, and then follow the prompts to enter the password.

Therefore, for the general user, we usually recommend modifying the ~/.bash_profile to set the environment variable, which is a user-level setting that is valid only for the current user.            Operation steps: 1, open terminal (terminal) 2, Input: VI ~/.bash_profile 3, set Path:export Path=/usr/local/mysql/bin: $PATH 4, enter:: Wq//Save and Exit VI 5, modify effective immediately: source ~/.bash_profile 6, view the value of the environment variable: echo $PATH Note: 1, ~/.bash_profile There is a point 2, if it is a new environment variable or to modify the value of the environment variable, you need to source a bit to take effect immediately. If you delete an environment variable, you must enter exit to logout the current shell, and then reopen a new shell and login to take effect.

Mac OS X configuration environment variables

Related Article

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.