From the course: Linux: Shells and Processes

Unlock the full course today

Join today to access over 24,800 courses taught by industry experts.

Variables and shell environment

Variables and shell environment - Linux Tutorial

From the course: Linux: Shells and Processes

Variables and shell environment

- The shell store has configuration items as well as information in Shell Variables. For example, the format of your shell prompt is stored in a variable named PS1. You can view this variable using the echo command. Whenever accessing variables, prefixed the variable name with the dollar sign. For instance, type in "echo $PS1" and hit enter. This shows my prompt format which equates to my username, the "@" symbol followed by the host name and the current working directory, and lastly the dollar sign. Not only can we read this information, but we can change it. Type in "PS1" equals double quote, backslash "u", colon, backslash "$", space double quote and hit enter. We can see that my prompt changed only include my username. This isn't saved anywhere so if I want to revert it back, I can just close a terminal and open it again. Now that we've seen how variables are used, let's talk about the types of variables. There…

Contents