Your cart
  • IMG
    {{cart_item.name}}
    {{cart_item.variation_attribute_name}}: {{cart_item.variation_attribute_label}}
    {{cart_item.item_unit}}: {{ setCurrency(cart_item.price)}}
    {{ setCurrency(cart_item.price*cart_item.quantity)}}
    Invalid quantity more than stock
Total :
{{setCurrency(cart.sub_total)}}

There is no item in the cart. If you want to buy, Please click here.

Environment Variable

Complete guide to start Linux OS and install essential applications in Linux

Created by :
Linux
tutorial
Programming, Software and application
1425
2022-01-09 18:30:29

An environment variable is a variable whose value is set outside the program, typically through functionality built into the operating system or micro-service. An environment variable is made up of a name/value pair, and any number may be created and available for reference at a point in time.

Example of environment variable:

$USER: Gives current user's name.

$PATH: Gives search path for commands.

$PWD: Gives the path of present working directory.

$HOME: Gives path of home directory.

$HOSTNAME: Gives name of the host.

$LANG: Gives the default system language.

$EDITOR: Gives default file editor.

$UID: Gives user ID of current user.

$SHELL: Gives location of current user's shell program.


To Display environment variable:

To see all environment variables:

env

or

printenv


You will find a list of environment variables as below:

SHELL=/bin/bash
SESSION_MANAGER=local/saidul-Inspiron-5502:@/tmp/.ICE-unix/3901,unix/saidul-Inspiron-5502:/tmp/.ICE-unix/3901
QT_ACCESSIBILITY=1
COLORTERM=truecolor
XDG_CONFIG_DIRS=/etc/xdg/xdg-ubuntu:/etc/xdg
XDG_MENU_PREFIX=gnome-
GNOME_DESKTOP_SESSION_ID=this-is-deprecated
LC_ADDRESS=bn_BD
GNOME_SHELL_SESSION_MODE=ubuntu
LC_NAME=bn_BD
................


To Display Value of variable:

Type echo $VARIABLE_NAME as like

echo $PATH



Setting environment variable:


To set a global ENV

 export NAME=Value 

or

set NAME=Value


Example:

export ORACLE_HOME=/home/oracle/app/oracle/product/19.0.0/client_1


See more about setting environment variable

To set a local ENV

To set user wide ENVs

To set system wide ENVs



To unset environment variables

unset NAME

or

NAME=''



Thanks!