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 $HOMENote
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/DocumentsAs you can see, $HOME and the
~ operator are interchangeable.
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access