


Local variablesĪ local variable exists only within a specific shell. Variables are case sensitive, and all Linux distributions use uppercase for environment variable names by default.

You can use the printenv or env commands to display the environment variables on your system: $ env command prints out all global environment variables. Global variables come predefined in your login shell, but they aren't immutable and can be modified or deleted according to your preferences. There are global, or system-defined, variables and local, or user-defined, variables. They're stored for the system shell, applications, and scripts to use when executing commands. Many of these variables are set by default during installation or user creation. When you say "my laptop," you're using "laptop" as a generic variable or placeholder for the computer you're carrying, regardless of whether it happens to be a Lenovo, Mac, or a Raspberry Pi in a fancy case.Įnvironment variables are special variables that contain information about your login session. You use variables every day in normal speech, although you don't think of them as such. In computing, a variable is a placeholder for a value that can change. How well do you know Linux? Take a quiz and get a badge.Linux system administration skills assessment.A guide to installing applications on Linux.Download RHEL 9 at no charge through the Red Hat Developer program.What is this variable, and how can you run commands that it can't find? When you're trying to run a command (with or without sudo) and get an error message that reads "Command not found," this means the script or file you're trying to execute doesn't exist in the location specified by your PATH variable.
