O'Reilly logo

CompTIA® Linux+ Certification, Powered by LPI, Student Manual by Axzo Press

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

52 CompTIA Linux+ Certification, Powered by LPI
Topic A: Shell configuration
This topic covers the following CompTIA exam objectives for Linux+ [Powered by
LPI] Certification, LX0-101 and LX0-102 exams.
# Objective
103.1 Work on the command line
Use and modify the shell environment including defining, referencing and
exporting environment variables
The following is a partial list of the used files, terms, and utilities:
echo
env
export
set
unset
103.8 Perform basic file editing operations using vi
Navigate a document using vi
Use basic vi modes
Insert, edit, delete, copy and find text
The following is a partial list of the used files, terms, and utilities:
vi
i, o, a
ZZ, :w!, :q!, :e!
104.7 Find system files and place files in the correct location
The following is a partial list of the used files, terms, and utilities:
type
105.1 Customize and use the shell environment
Set environment variables (e.g. PATH) at login or when spawning a new
shell
Write BASH functions for frequently used sequences of commands
Set command search path with the proper directory
The following is a partial list of the used files, terms, and utilities:
/etc/profile
env
export
set
unset
~/.bash_profile
~/.bash_login
~/.profile
~/.bashrc
~/.bash_logout
function
alias
User environment configuration 53
Environment variables
Explanation Linux saves various configuration values in memory for each user on the system. There
are two types of such variables: shell variables and environment variables. Shell
variables are values that exist for a single instance of a shell. Environment variables are
accessible to the shell in which they were set as well as to any child processes and
subshells.
Shell and environment variables are essentially identical. They differ only in where they
are accessible. For that reason, unless we need to describe one type explicitly, we
simply call them all variables.
Variables store information needed by the operating system and applications to locate
files, determine which shell to use, what language output to use, and so forth. By
convention, variables are named in all uppercase. You can create your own user-defined
variables. Those too are, by convention, in all caps. The following table lists some of
the standard BASH variables.
Variable Description
BASH Full path to the BASH shell executable.
EDITOR
The absolute path of text editor programs, such as vi.
ENV Path to the BASH runtime configuration utility (typically ~/.bashrc).
EUID The effective user ID of the logged-in user.
HISTFILE The path to the history file.
HISTFILESIZE The number of commands to be stored in the history.
HOME The absolute path to the user’s home directory.
HOSTNAME The host name of the computer.
LOGNAME The current user’s login name.
MAIL The absolute path to the user’s mail file.
PAGER
The absolute path of the default programs, such as
less or more,
through which files are output for paged display.
PATH A list of directories to search for executables when users enter
commands without absolute or relative path names.
PRINTER The name of the default printer.
PS1 The prompt for the primary shell.
PS2 The prompt for the secondary shell.
PWD and OLDPWD The current and previous working directories, respectively.
TERM and TERMCAP Variables used on older systems to identify the console (non-GUI
terminal) and its settings. TERM is usually set to “linux” on new
systems and “console” on older systems.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required