Introduction
In this challenge, you will learn how to set up and manage environment variables in a Linux system as a junior system administrator. The goal is to create a permanent environment variable named PROJECT_DIR that points to the /home/labex/project directory, and verify that the variable is correctly set and accessible in the current shell session.
Configure Linux Environment Variables
As a junior system administrator, you'll learn how to set up and manage environment variables in a Linux system to create a consistent development environment.
Tasks
- Create a permanent environment variable named
PROJECT_DIRthat points to/home/labex/project - Verify the environment variable is correctly set and can be accessed in the current shell session
Requirements
- Use the
exportcommand to set the environment variable - Add the environment variable to the
~/.zshrcconfiguration file - Ensure the variable can be accessed by running
echo $PROJECT_DIR - Work within the
/home/labexdirectory
Examples
Example of a correctly set environment variable:
echo $PROJECT_DIR
PROJECT_DIR=/home/labex/project
Hints
- Remember to use
exportto create a permanent environment variable - Use
source ~/.zshrcto reload the configuration file - Check the contents of the
.zshrcfile after modification
Summary
In summary, this challenge focuses on teaching junior system administrators how to set up and manage environment variables in a Linux system. The key tasks include creating a permanent environment variable named PROJECT_DIR that points to the /home/labex/project directory, and verifying that the variable is correctly set and accessible in the current shell session.



