Published Dec 16, 2022Updated Jan 2, 2023
Contribute to Docs
Environment variables consist of name-value pairs and are set outside of applications, but are accessible to them from the environment in which the applications are run.
Environment variables are often set via the terminal or in a script. How they are managed and retrieved varies depending on the operating system or environment. For example, they can be used to store system configuration data or private keys for applications.
Relationship with Unix and Unix-like Variants
On Unix and Unix-like variants such as Linux, environment variables allow for configuration of the system and its applications. They can contain information such as the default language for the system, which default text editor to use, and paths to executable files.
Some Common Environment Variables
||Contains a list of directories that the terminal searches for commands.|
||The default path to the current user’s home directory.|
||The current user’s name.|
||The default locale.|
Looking to contribute?
- Learn more about how to get involved.
- Edit this page on GitHub to fix an error or make an improvement.
- Submit feedback to let us know how we can improve Docs.
Learn Command Line on Codecademy
Computer ScienceLooking for an introduction to the theory behind programming? Master Python while learning data structures, algorithms, and more!
Includes 6 Courses
With Professional Certification