How to Set environment variables in Mac

Source: Internet
Author: User

1 first, view the path

Command: $ path

2. How to set path

Command: Echo "Export Path = xxxxxx: $ path" >> ~ /. Bash_profile

Explanation: Print "Export Path = xxxxxx: $ path" ~ /. Bash_profile.

3. UNIX knowledge supplement :~ /. Bash_profile Introduction

Mac and Linux terminals generally use bash for parsing. After bash finishes reading the/etc/profile of the overall environment variable and calls other configuration files, it then reads the User-Defined personal configuration file. Bash reads three types of files:

~ /. Bash_profile ~ /. Bash_login ~ /. Profile

In fact, bash is a read-only file, and the read order is in the above Order. That is to say, reading bash_profile will not be followed by reading it. If bash_profile does not exist, the following will be available.

Let's take a look at what is in bash_profile:

Command: CAT ~ /. Bash_profile

The figure shows the content.

The root permission is required to view some folders.

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.