0% found this document useful (0 votes)
19 views11 pages

033 Environment Variables

The document provides an overview of environment variables, including common variables such as EDITOR, HOME, and PATH, along with their descriptions. It explains how to view, export, and remove environment variables using commands like printenv, echo, and unset. The document serves as a guide for understanding and managing environment variables in a user environment.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
19 views11 pages

033 Environment Variables

The document provides an overview of environment variables, including common variables such as EDITOR, HOME, and PATH, along with their descriptions. It explains how to view, export, and remove environment variables using commands like printenv, echo, and unset. The document serves as a guide for understanding and managing environment variables in a user environment.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 11

Environment Variables

What You Will Learn


● Environment Variables
Common Environment Variables

Variable Description
EDITOR Program to run to perform edits
HOME Home directory of the user.
LOGNAME The login name of the user.
MAIL The location of the user’s local inbox.
Common Environment Variables

Variable Description
OLDPWD The previous working directory.
PATH A list of directions to search for
commands.
PAGER Program used to paginate through
files.
Common Environment Variables

Variable Description
PS1 The primary prompt string.
PWD Present working directory.
USER The username of the current user.
Viewing Environment Variables
printenv - Print all or part of environment.

echo $ENV_VAR - Print the ENV_VAR variable.


Demo - env vars
Exporting Environment Variables
export - Allows vars to be used by subshells.
Demo - export
Removing Variables
unset - delete an environment varialbe.
Removing Variables
$ echo $PAGER
less
$ unset PAGER
$ echo $PAGER

You might also like