Env, PS1
Env, PS1
---------------------
envt variables are used to store info about the env in which program runs such as
paths of files and directories,user preference and system setting.
printenv--->command to check env variables.
for examples:
echo --> to print the contents of variables
echo "$SHELL"
echo "$BASH"
echo "$USER
PS1
-----
In Linux, PS1 is a shell variable used to define the format of the primary command
prompt. It allows users to customize the appearance of the prompt according to
their preferences. Here's a breakdown of PS1 along with some examples:
Basic PS1 Structure: The PS1 variable contains special escape sequences, which are
replaced by various information when the prompt is displayed. The most common ones
are:
Color Codes
Here are the color codes you can use:
Black: \e[0;30m
Red: \e[0;31m
Green: \e[0;32m
Yellow: \e[0;33m
Blue: \e[0;34m
Magenta: \e[0;35m
Cyan: \e[0;36m
White: \e[0;37m
And for bright colors:
Description
$USER
$PATH
$HOME
$PWD
$HOSTNAME
$LANG
$EDITOR
$UID