$
Learn Linux handbook
en
XP:0
Quest 115Env-Architect
+250 XP

Managing Environment Variables

Launch Interactive Terminal for This Quest→No installation required • Runs fully in browser

Concept & Overview

Imagine you are deploying a web application, and it needs to know whether to run in a safe local "development" sandbox or connect to the live "production" database. In Linux, we pass configurations like this to running programs using environment variables.

- We use the export command to define a variable so that any programs started by our shell can read it. E.g., export APP_ENV=production.
- To check or display a variable's value, we prefix its name with a dollar sign: echo $APP_ENV.

Let's configure the environment. Set and export a variable named APP_ENV with the value production by running export APP_ENV=production, and then verify it by running echo $APP_ENV.

Command Syntax Reference

Command / SyntaxDescription
export VAR=valDefine environment variable
echo $VARPrint variable value

Verification Objectives

These conditions will be automatically verified when you run commands inside the interactive terminal simulator:

  • ○
    Run the "export" command
  • ○
    Set APP_ENV env variable to "production"
  • ○
    Print variable using "echo $APP_ENV"

Ready to complete Quest 115?

Test your skills live in the browser terminal with an emulated Linux filesystem, real-time command evaluation, and instant step-by-step hints.