Red Hat System Administration II Exam
Questions And Answers 100% Verified And
Updated.
The GUID Partition Table (GPT) partitioning scheme # GPT partitioning offers additional
features and benefits over MBR. A GPT uses a globally unique identifier (GUID) to identify
each disk and partition. A GPT makes the partition table redundant, with the primary GPT at the
head of the disk, and a backup secondary GPT at the end of the disk. A GPT uses a checksum to
detect errors in the GPT header and partition table. - Answer✔The Master Boot Record (MBR)
partitioning scheme is the standard on systems that run BIOS firmware. This scheme supports a
maximum of four primary partitions. On Linux systems, with extended and logical partitions,
you can create up to 15 partitions. With a 32-bit partition size, disks that are partitioned with
MBR can have a size of up to 2 TiB. The 2 TiB disk and partition size limit is now a common
and restrictive limitation. Consequently, the legacy MBR scheme is superseded by
____________. It is the standard for disk partitioning and addresses the limitations of the MBR
scheme, provideing a maximum of 128 partitions. The scheme allocates 64 bits for logical block
addresses, to support partitions and disks of up to eight zebibytes (ZiB) or eight billion tebibytes
(TiB).
Bash shell script - Answer✔An executable file that contains a list of commands, possibly with
programming logic to control decision-making in an overall task.
the #! notation # This notation is an interpreter directive that indicates the command interpreter
and optional command options that are needed to process the remaining lines of the file. For
normal Bash syntax script files, the first line is this directive: #!/usr/bin/bash - Answer✔The first
line of a Bash shell script begins with ____________. A shell script file must have execute
permissions to run it as an ordinary command. Use the chmod command to modify the file
permissions. Use the chown command, if needed, to grant execute permission only for specific
users or groups. If the script is stored in a directory that is listed in the shell's PATH
environmental variable, then you can run the shell script by using only its file name, similar to
running compiled commands. If a script is not in a PATH directory, run the script using its
absolute path name, which can be determined by querying the file with the which command.
Alternatively, run a script in your current working directory using the . directory prefix, such as
./scriptname.
globbing (file name pattern matching) and shell expansion;
1|Page
, ©FYNDLAY 2024/2025 ALL RIGHTS RESERVED.
command and variable substitution # Variable substitution is conceptually identical to command
substitution, but might use optional brace syntax. - Answer✔Use double quotation marks to
suppress ____________, but still allow ____________.
for VARIABLE in LIST; do
COMMAND VARIABLE
done
# The variable name is arbitrary. Typically, you reference the variable value with commands in
the command block. Provide the list of strings for the for loop from a list that the user enters
directly, or that is generated from shell expansion, such as variable, brace, or file name
expansion, or command substitution.
#ex: for HOST in host1 host2 host3; do echo $HOST; done - Answer✔Bash for-loop syntax
exit # Use the exit command with an optional integer argument between 0 and 255, which
represents an exit code. An exit code is returned to a parent process to indicate the status at exit.
An exit code value of 0 represents a successful script completion with no errors. All other
nonzero values indicate an error exit code. The script programmer defines these codes. Use
unique values to represent the different error conditions that are encountered. Retrieve the exit
code of the last completed command from the built-in $? variable. When a script's exit command
is used without an exit code argument, then the script returns the exit code of the last command
that was run within the script. - Answer✔After a script interprets and processes all of its content,
the script process exits and passes control back to the parent process that called it. However, a
script can be exited before it finishes, such as when the script encounters an error condition. Use
the ____________ command to immediately leave the script, and skip processing the remainder
of the script.
test # Perform tests by using various operators to determine whether a number is greater than
(gt), greater than or equal to (ge), less than (lt), less than or equal to (le), or equal (eq) to another
number.
Use operators to test whether a string of text is the same (= or ==) or not the same (!=) as another
string of text, or whether the string has zero length (z) or has a non-zero length (n). You can also
test if a regular file (-f) or directory (-d) exists and some special attributes, such as if the file is a
symbolic link (-L) or if the user has read permissions (-r);
[ <TESTEXPRESSION> ] or the newer extended test command syntax, [[
<TESTEXPRESSION> ]] # In most cases you should use the [[ ]] syntax. - Answer✔To ensure
that unexpected conditions do not easily disrupt scripts, it is recommended to verify command
input such as command-line arguments, user input, command substitutions, variable expansions,
and file name expansions. You can check integrity in your scripts by using the Bash
____________ command. All commands produce an exit code on completion.
To see the exit status, view the $? variable immediately following the execution of the command.
An exit status of 0 indicates a successful exit with nothing to report, and nonzero values indicate
2|Page
, ©FYNDLAY 2024/2025 ALL RIGHTS RESERVED.
some condition or failure. Alternatively, perform tests by using the Bash command syntax,
____________, which provides features such as file name globbing and regex pattern matching.
if <CONDITION>; then
<STATEMENT>
...
<STATEMENT>
fi - Answer✔The if/then syntax
if <CONDITION>; then
<STATEMENT>
...
<STATEMENT>
else
<STATEMENT>
...
<STATEMENT>
fi - Answer✔The if/then/else syntax
if <CONDITION>; then
<STATEMENT>
...
<STATEMENT>
elif <CONDITION>; then
<STATEMENT>
...
<STATEMENT>
else
<STATEMENT>
...
<STATEMENT>
fi - Answer✔Expand an if/then/elif/else syntax
-E;
3|Page
, ©FYNDLAY 2024/2025 ALL RIGHTS RESERVED.
-E - Answer✔There are two types of regular expressions: basic regular expressions and extended
regular expressions.
One difference between basic and extended regular expressions is in the behavior of the |, +, ?, (,
), {, and } special characters. In basic regular expression syntax, these characters do not have
special meaning unless prefixed with a backslash \ character. In extended regular expression
syntax, these characters are special unless they are prefixed with backslash \ character. There are
also other minor differences in how the ^, $, and * characters are handled.
The grep, sed, and vim commands use basic regular expressions. The grep command
____________ option, sed command ____________ option, and less commands use extended
regular expressions.
-i;
-v;
-r;
-A NUMBER;
-B NUMBER;
-e;
-E - Answer✔The grep command has many useful options for controlling how it parses lines.
Use the provided regular expression but do not enforce case sensitivity (run case-insensitive)
with the ____________ option. Display only lines that do not contain matches to the regular
expression with the ____________ option. Search for data that matches the regular expression
recursively in a group of files or directories with the ____________ option. Display NUMBER
of lines after the regular expression match with the ____________ option. Display NUMBER of
lines before the regular expression match with the ____________ option. Multiple regular
expressions can be supplied and are used with a logical OR using the ____________ option. Use
extended regular expression syntax instead of basic regular expression syntax when parsing the
provided regular expression with the ____________ option.
grep -v '^[#;]' file_name - Answer✔CLI: Exclude all the lines that begin with a hash character
(#) or a semicolon (;) character in a search on a file
at TIMESPEC # # The at package provides the atd system daemon, and the at and atq commands
to interact with the daemon. Any user can queue jobs for the atd daemon by using the at
command. The atd daemon provides 26 queues, identified from a to z, with jobs in alphabetically
later queues getting lower system priority;
at now +5min < myscript;
atq or the at -l;
at -c JOBNUMBER;
atrm JOBNUMBER - Answer✔Use the ____________ command to start entering a new job to
schedule. The command then reads from STDIN (your keyboard) to obtain the commands to run.
4|Page