Other Environment Variables
Ubuntu also provides many other environment variables; some of the more common ones are listed in Table 7-3.
Table 7-3. Common environment variables
Environment variable | Contents |
---|---|
| Your home folder |
| The default language |
| The path to the |
| The system path |
| The current working directory |
| The current shell |
| The time zone |
| Your username |
Each variableâs contents can be displayed using the echo
command, like this:
echo $HOME
Note
Most commands require you to preface variables with a $
sign to let the operating system know that
you are referring to a variable and not just a string of
letters.
You can also use environment variables in paths, so you could list the contents of the Documents folder within your home folder using this command:
ls $HOME/Documents
As you can see, $HOME
and the
~
operator are interchangeable.
Get Ubuntu: Up and Running now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.