Environment Variables
Published Dec 16, 2022Updated Sep 14, 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
Variable | Description |
---|---|
PATH |
Contains a list of directories that the terminal searches for commands. |
HOME |
The default path to the current user’s home directory. |
USER |
The current user’s name. |
LANG |
The default locale. |
Contribute to Docs
- 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
- Career path
Computer Science
Looking for an introduction to the theory behind programming? Master Python while learning data structures, algorithms, and more!Includes 6 CoursesWith Professional CertificationBeginner Friendly75 hours - Course
Learn the Command Line
Learn about the command line, starting with navigating and manipulating the file system, and ending with redirection and configuring the environment.With CertificateBeginner Friendly4 hours