How to set environment variables in macOS system

tags: Environment Variables  macOS

Display current environment variables

fxdeMacBook-Pro:~ fx$ printenv

The above command shows all environment variables if you want to view an environment variable:

fxdeMacBook-Pro:~ fx$ echo *** (the name of the environment variable you want to view)

Change environment variables once:

export [existing_variable_name]=[new_value]:$[existing_variable_name]

Permanently set environment variables:

Add to the .bash_profile file, vi ~/.bash_profile, if the file does not exist, the command will create the file

Export environment variable name=value

Restart the command line to load the new environment variables.

 

Translated from:https://medium.com/@himanshuagarwal1395/setting-up-environment-variables-in-macos-sierra-f5978369b255

Intelligent Recommendation

Set system environment variables in django

[Recommended] 2019 Java Developers' Job-hopping Guide.pdf (Hematemesis Finishing) >>> demand: Due to system limitations, it is necessary to set system environment variables in the logic code ...

Ubuntu18.4 set system environment variables

Ubuntu18.4 set system environment variables Env View system environment variables Path path executable path ":" is the path interval Export Path = $ {path}: "Path" setting PATHCurr...

java get and set system variables (environment variables)

A, Java environment variables Java Environment variables very simple way: System.getEnv()Get all the environmental variables System.getEnv(key) Get an environment variable Second, the acquisition syst...

Set system variables and environment variables for php

Seeing this title, there are two questions, whether to set the system environment variable for php.exe or set the environment variable for the programming language to directly call the environment var...

How to set Python environment variables?

Python download address:https://www.python.org/ Click Downloads - All releases to download the required version for installation.   1. Find the downloaded python installation directory (the insta...

More Recommendation

How to set environment variables in Ubuntu

First, start the terminal. Click on the upper left corner of the Ubuntu icon in the pop-up window, click the search bar, enter "terminal", Wait a moment, the terminal will impressively in th...

How to set environment variables ubuntn

Common set environment variables in the following ways: Reference links: (1), set up temporary environment variables This time we can use export PATH = ...: $ PATH, for example, export PATH = / home /...

How to set java environment variables

The first task of learning Java is to build the environment and configure the environment variables. Reprinted http://jingyan.baidu.com/article/e75aca85508d15142edac6b8.html is not responsible for cop...

How to set environment variables in vue

There are generally three environments during development: development environment, test environment, online environment There is a concept in vue is mode, by default there are three modes in vue cli ...

How to set environment variables in Linux

1. export PATH=$PATH:hello [only valid for current bash] Modify environment variables by adding paths 2. Modify the .bash_profile file in the user directory, add a path to it, and it will take effect ...

Copyright  DMCA © 2018-2026 - All Rights Reserved - www.programmersought.com  User Notice

Top