Pt 2 Ch. 11 The Environment Flashcards
What knowledge allows us to use the environment to customize our shell experience?
Some programs look for values stored in the environment to adjust their behavior.
The shell stores two basic types of data in the environment
- environment vaiables 2. shell variables
What’s the best way to view the enviornment?
prinenv | less or set | less
How do set and printenv differ?
The set command shows both the shell and environment variables. Printenv shows only the latter
What does printenv show us?
A list of environment variables and their values
How can the printnenv command list the value of a specific variable?
printenv USER
me
What one element of the environment does neither set nor printenv display?
aliases
How do you see the aliases in the enivornment?
enter alias command without arguments
The name of the display if we are running a graphical environment.
Usually this is “:0”, meaning the first display generated by the X
server.
Display
The name of the program to be used for text editing.
EDITOR
The name of the user’s default shell program.
SHELL
The pathname of your home directory.
HOME
Defines the character set and collation order of your language.
LANG
The previous working directory.
OLDPWD
The name of the program to be used for paging output. This is often
set to /usr/bin/less.
PAGER
A colon-separated list of directories that are searched when we enter
the name of a executable program
PATH
This stands for “prompt string 1.” This defines the contents of the
shell prompt. As we will later see, this can be extensively
customized.
PS1
This stands for “prompt string 1.” This defines the contents of the
shell prompt. As we will later see, this can be extensively
customized.
PS1
The current working directory.
PWD
The name of your terminal type. Unix-like systems support many
terminal protocols; this variable sets the protocol to be used with
your terminal emulator.
TERM
Specifies your time zone. Most Unix-like systems maintain the
computer’s internal clock in Coordinated Universal Time (UTC)
and then display the local time by applying an offset specified by
this variable.
TZ
USER
Your username
What do startup files do
They define the default environment shared by all users. When we log on to the system, the bash program starts, and reads these series of configurations scripts.
A session is one in which we are prompted for
our username and password. This happens when we start a virtual console session,
for example.
A login shell session