E-learning module "Linux Basics"

Environment and Variables

A user often needs information about the environment he is working on.

Examples:

$ uname                           → Deliver various system information.
$ uname -r                     → 3.19.8.9-1-MANJARO

$ free                             → Provides information about used and free memory.

$ echo                             → Print a line of text.
$ echo "Hello world" → Hello world

  

Echo can not only print simple text, but also the content of variables:

$ var="Hello" → Set variable var to the value Hello.

$ echo $var     → Print the value of var.
and
$ echo ${var} → Print the value of var.

  

Linux often uses variables. Various variables exist and are preset by default.

Examples of standard variables:

$ echo $USER            → The value of the variable USER.
$ echo ${LOGNAME}  → The value of the variable LOGNAME.

The content of this e-learning module is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Germany license (CC BY-NC-SA 3.0 DE).



Bisher wurde noch kein Kommentar abgegeben.