3. Environmental Variables

  • /usr/bin/env

  • /etc/environment

Environmental Variables

Name

Description

PWD

Present Working Directory

UID

User ID

HOME

User Home Directory

PATH

Executable Search Path

SHELL

Current Shell

TERM

Current Terminal (character mapping)

PS1

Prompt

LANG

System Language

HOSTNAME

Hostname

IFS

Inter Field Separator

UMASK

Permission mask for new files

3.1. Environmental Variables

3.1.1. PS1

../_images/bash-colors.png

Bash colors

## Prompt
red='\[\033[00;31m\]'
green='\[\033[00;32m\]'
blue='\[\033[00;36m\]'
white='\[\033[00;39m\]'

export PS1="\n${green}$ ${white}"

[ $SSH_CONNECTION ] && export PS1="\n${green}\h $ ${white}"
[ $UID == 0 ] && export PS1="\n${red}# ${white}"