Title: IT / LPIC 101 Q/A / 3 *NIX Commands

Q: Assume that you’re using the Bash shell and want to prevent output redirects from accidentally overwriting existing files. Which command and option can be used to invoke this behavior?
setoutput -f
overwrite=no
overwrite -n
set -C
A: D. The set command can be used for a variety of purposes to change how the shell environment works. One such option is –C, which prevents output redirection such as that done with > from overwriting a file if the file already exists.

Q: What command can be used to view the current settings for your environment when using Bash?
environment
env
listenv
echoenv
A: B. The env command will print the current environment variables from Bash. The printenv command will perform the same operation. The other commands listed in this question do not exist.

Q: Which command is used to access documentation on the Linux computer for a given command?
doc
heredoc
man
manual
A: C. The man command displays documentation for the command given as the argument. The other options listed for this question do not exist.

Q: Which of the following commands will print various information about the kernel and architecture, along with other details?
info --sys
man sys
sysinfo
uname -a
A: D. The uname command is used to print system information, and the -a option prints all information available to uname.

Q: When using sed for a substitution operation, which option must be included so that the substitution applies to the entire line rather than just the first instance?
g
a
r
y
A: A. The g option, also known as global or greedy, will apply the matched operation to the entire line rather than just the first instance of the match. The other options apply as they would for a Perl-Compatible Regular Expression. Note also the tr command that provides some of the same functionality as sed.

Q: Which option for the wc command prints the number of lines given as input?
-f
-a
-l
-o
A: C. The -l option provides the number of lines given as input. For example, wc -l /etc/passwd would print the number of lines in the /etc/passwd file. The other options given in this question are not valid for the wc command.

Q: What is the default number of lines printed by the head and tail commands, respectively?
10 for head, 5 for tail
5 for head, 10 for tail
10 for both head and tail
3 for both head and tail
A: C. Both head and tail print 10 lines of output by default.

Q: You are attempting to use rmdir to remove a directory, but there are still multiple files and other directories contained within it. Assuming that you’re sure you want to remove the directory and all of its contents, what is the command and arguments to remove the directory and all of its contents?
rm -f
rm -rf
rmdir -a
rmdir -m
A: B. The -rf options to rm will recursively remove the contents of a directory, including other directories. The -f option alone will not work in this case because of the additional directories. The other options given for rmdir do not exist.

Q: Which command will find directories with names beginning with 2014 located beneath the current directory?
find ./ -name "2014"
find ./ -type d -name "2014"
find / -type d "2014"
find ./ -type d -name "2014*"
A: D. The -type option causes find to limit its search to directories only, whereas the -name option limits the names of returned elements. Note the use of the wildcard due to the phrasing of the question. Also note the use of ./ to denote beginning the search in the current directory.

Q: Which of the following commands will provide the usernames in a sorted list gathered from the /etc/passwd file?
cat /etc/passwd | awk -F : '{print $1}' | sort
sort /etc/passwd | cut
echo /etc/passwd
cat /etc/passwd | awk '{print $1}' | sort
A: A. The cat command will display the contents of file /etc/passwd and then pipe that output to the awk command. The awk command then parses its input, splitting along the specified separator for /etc/passwd, which is a colon (:). The output is then printed and piped to the sort command. The sort command in option B will not work because the cut command requires an argument. Likewise, the echo command in option C will only echo /etc/passwd to STDOUT.

Q: Which options to ls will produce output, including hidden (dot) files, in a list that is ordered such that the newest files are at the end of the output?
-la
-lat
-latr
-ltr
A: C. The -l option for ls produces long or listed output and -t sorts by time stamp. The -r option reverses the order, and -a is needed to include hidden (dot) files, making option C correct.

Q: What will be the result if the touch command is executed on a file that already exists?
The access time stamp of the file will change to the current time when the touch command was executed.
The file will be overwritten.
There will be no change.
The file will be appended to.
A: A. The time stamp of the file will change when touch is run on a file that already exists.

Q: Which option to both mv and cp will cause the command to prompt before overwriting files that already exist?
-f
-Z
-r
-i
A: D. The -i option will cause both cp and mv to be interactive, that is, prompt before overwriting. The -f option will force the command to run, whereas -r is recursive.

Q: Which of the following commands will send the contents of /etc/passwd to both STDOUT and to a file called passwordfile?
cat /etc/passwd > passwordfile
var /etc/passwd | passwordfile
cat /etc/passwd | tee passwordfile
echo /etc/passwd | stdout > passwordfile
A: C. The tee command will send output both to STDOUT and to the specified file, making option C correct. Option A will redirect output to the correct file but not to STDOUT simultaneously. The other options will not work for this question.

Q: The current hierarchy on the server contains a directory called /usr/local. You need to create additional directories below that are called /usr/local/test/october. Which command will accomplish this task?
mkdir -p /usr/local/test/october
mkdir /usr/local/test/october
mkdir -r /usr/local/test/october
mkdir -f /usr/local/test/october
A: A. The -p option will cause mkdir to create additional levels of directories without error. Running mkdir without options will not work in this case. The -r and -f options to mkdir do not exist.

Q: Which option to the cp command will copy directories in a recursive manner?
-v
-R
-Z
-i
A: B. The -R option will copy directories recursively. Note that if the -i option is not enabled, the recursive copy will overwrite files in the destination. The -v option adds verbosity but does not cause any recursion, and the -Z option does not exist.

Q: You have received a file that does not have a file extension. Which command can you run to help determine what type of file it might be?
grep
telnet
file
export
A: C. The file command can be used to determine which type of file is being used. This can be particularly helpful for files without extensions where you are unsure if you should view the contents of the file. Option A, grep, is used to look within files but would not be helpful in this case. The telnet and export commands are not used for this purpose.

Q: Which command will create an image of the /dev/sda1 disk partition and place that image into a file called output.img?
dd if=sda of=/dev/sda1
dd if=output.img of=/dev/sda1
dd if=/dev/sda1 of=output.img
echo /dev/sda1 > output.img
A: C. The dd command is used to create disk images, among other things. In this case, the input file is /dev/sda1 and the output file is output.img. It’s also common to add the blocksize option by using the bs argument, such as bs=1M.

Q: What is the default delimiter used by the cut command?
Colon
Tab
Space
Comma
A: B. The cut command uses Tab as its default delimiter. This can be changed with the -d option.

Q: Which of the following will unzip and extract the contents of a file that has been tarred and gzipped?
tar -zxf <file.tgz>
tar -xf <file.tgz>
tar -vz <file.tgz>
tar -fd <file.tgz>
A: A. The -z option will unzip the file, -x will extract from the tar archive, and -f is used to indicate the file on which to perform the aforementioned operations. It’s typical to add -v for verbose output as well.

Q: What command is used to bring a command to foreground processing after it has been backgrounded with an &?
bg
fore
4g
fg
A: D. The fg command will bring a command to the foreground if it has been backgrounded with either & or with the bg command.

Q: You need to write a script that gathers all of the process IDs for all instances of Apache running on the system. Which of the following commands will accomplish this task?
ps auwx | grep apache
pgrep apache
processlist apache
ls -p apache
A: B. While the ps auwx command combined with grep will provide information on the running Apache instances, it will provide much more information than is required or useful for this problem. The pgrep command provides only the process IDs and therefore meets the criteria presented in the question.

Q: Which of the following command lines would monitor a single process called nagios in a continuous manner?
top -n 1
top -p 23
ps -nagios
top -p`pidof nagios`
A: D. The top command is used to continuously monitor things like CPU and memory usage, and the -p option monitors a single process. By using the runquotes with the pidof command, the process ID is provided as input to the -p option.

Q: Users are reporting that various programs are crashing on the server. By examining logs, you see that certain processes are reporting out-of-memory conditions. Which command can you use to see the overall memory usage, including available swap space?
tree
pgrep
uptime
free
A: D. The free command displays overall memory usage for both RAM and swap and can be used to determine when additional memory might be needed.

Q: You are using the Vi editor for changing a file and need to exit. You receive a notice indicating "No write since last change". Assuming you want to save your work, which of the following commands will save your work and exit Vi?
:wq
:q!
dd
x
A: A. You need to write the changes to the file; therefore you’ll need :w. The addition of q will also quit. Note that you could use ZZ to write and quit as well. The dd command deletes a line, and x deletes a single character.

Q: What option is used to change the number of lines of output for the head and tail commands?
-l
-f
-g
-n
A: D. The -n option changes the number of lines of output for both head and tail to the number specified. The other options listed in this question are not valid for head, and the -f option follows a file with tail as the file grows.

Q: Which command can be used to determine the current load average along with information on the amount of time since the last boot of the system?
uptime
sysinfo
bash
ls -u
A: A. The uptime command shows basic information such as that described along with the number of users logged into the system and the current time. The bash command is a shell environment, and the ls command will not display the required information.

Q: You need to start a long-running process that requires a terminal and foreground processing. However, you cannot leave your terminal window open due to security restrictions. Which command will enable you to start the process and return at a later time to continue the session?
fg
bg
kill
screen
A: D. The screen command starts a new terminal that can be disconnected and reconnected as needed. Processes running from within the screen session do not know that they are running in a screen session and therefore meet the criteria needed to satisfy this question. The fg and bg commands will not meet the criteria, and the kill command will stop a process.

Q: You have attempted to stop a process using its service command and also using the kill command. Which signal can be sent to the process using the kill command in order to force the process to end?
-15
-f
-9
-stop
A: C. The -9 option invokes SIGKILL, which will force the process to end. The 15 signal is the default, and the -f and -stop options do not exist.

Q: When working in the Bash shell, you need to redirect both STDOUT and STDERR. Which of the following commands will redirect both STDOUT and STDERR?
1>2
>2
2>&1
>>
A: C. Within Bash, the number 1 represents STDOUT and 2 represents STDERR. Redirecting both means combining them in the manner shown in option C.

Q: Which command can be run to determine the default priority for processes spawned by the current user?
prio
nice
renice
defpriority
A: B. The nice command, when run without arguments, will output the priority for the currently logged-in user, which is normally 0. The renice command can be used to change the priority of running processes. The other two commands shown as options for this question do not exist.

Q: Which of the following egrep commands will examine /etc/passwd to find users who are using either /bin/bash or /usr/bin/zsh for their shell environment?
grep sh /etc/passwd
egrep '/*/.sh$' /etc/passwd
grep '/*/.=sh$' /etc/passwd
egrep '/*/..?sh$' /etc/passwd
A: D. Within a regular expression, * represents 0 or more characters. In this case, it doesn’t matter whether a person is using /bin/bash or /usr/bin/zsh. Likewise, a . matches a single character, but in the case of bash and zsh, we need to look at the first and then optionally a second character. The ? character makes the second . optional. Finally, the $ anchors the pattern at the end of the string and is also the key for this regular expression.

Q: Which option to the man command accesses a different level of documentation, for example, system call documentation?
man 2 <argument>
progman <argument>
man --sys <argument>
man --list sys
A: A. The different levels of the manual are accessed by preceding the argument with the desired level. The other options, such as --list, do not exist in this context.

Q: When editing with Vi, which command changes to insert mode and opens a new line below the current cursor location?
f
a
o
i
A: C. The o command opens a new line below the current cursor location. The a command begins an insert mode session at the character after the cursor, not the line. The i command begins an insert mode session at the current cursor location.

Q: Which kill signal can be sent in order to restart a process?
-HUP
-RESTART
-9
-SIG
A: A. Sending -HUP as part of the kill command will restart a process. Of the other options, a -9 will kill the process completely. The other two options do not exist as valid means to kill a process.

Q: Which of the following commands will display the last 50 lines of your command history when using Bash, including commands from the current session?
bashhist 50
history 50
cat .bash_history
tail -f .bash_history
A: B. The history command will display your command history, including commands from the current session. You can specify how many lines of history to display, as shown in the answer for this question. Note that .bash_history will not show the current session’s history.

Q: You have backgrounded several tasks using &. Which command can be used to view the current list of running tasks that have been backgrounded?
procs
plist
jobs
free
A: C. The jobs built-in command shows the list of jobs running in the background. Its output includes a job number and the status of the job.

Q: Which of the following commands searches each user’s .bash_history file to determine whether the user has invoked the sudo command?
find /home -name "bash_history" | grep sudo
find /home -name ".bash_history" | xargs grep sudo
find /home/.bash_history | xargs grep sudo
find /home -type history | xargs grep sudo
A: B. The find command, beginning with the path and then the -name argument, will locate all of the files called .bash_history. The output from the find command should be piped to xargs, which can then build further commands from standard input. Note that this question and solution assumes that all users use the Bash shell and are keeping history.

Q: Which command will watch the Apache log at /var/log/httpd/access.log and continually scroll as new log entries are created?
watch /var/log/httpd/access.log
tail /var/log/httpd/access.log
tail -f /var/log/httpd/access.log
mon /var/log/httpd/access.log
A: C. The tail command provides the end portion of the file given as an argument. Adding the -f option will cause the output to update as new lines are added to the file being tailed.

Q: You are debugging a configuration file and the daemon indicates there is a problem on line 932. Which of the following commands will prepend line numbers onto the file?
lines
wc -l
newline
nl
A: D. The nl command will prepend line numbers onto the file given as its argument. The output is then sent to STDOUT. Of the other options, wc -l will print the number of lines in the file but not prepend those numbers onto each line, as was asked for in this question.

Q: You receive a file with an .lzma extension. Which command can you use to decompress this file?
xz
lz
gz
bzip
A: A. The xz command can compress and decompress files in a variety of formats, one of which is lzma.

Q: Which find command will locate files within the current directory that have been modified within the last 24 hours?
find ./ -type f -mtime 0
find ./ -type f -mtime 24
find ./ -type f -mtime +1
find ./ type -f time 24
A: A. The find command will be used for this purpose. Adding -type f will limit the search to only files and the -mtime option will limit to modification time in day format.

Q: Which command will move all files with a .txt extension to the /tmp directory?
mv txt* tmp
move *txt /temp
mv *.txt /tmp
mv *.txt tmp
A: C. The mv command is used to move files, and *.txt will look for all files with a .txt extension. Note the fully qualified destination with a / preceding the name tmp.

Q: Which command prints your current directory?
cwd
curdur
cd
pwd
A: D. The pwd command prints the current working directory. The cd command changes directory.

Q: Assume that you have a file called zips.txt that contains several postal ZIP codes and you need to determine how many unique ZIP codes there are in the file. Which of the following commands can be used for that purpose?
sort zips.txt | uniq -c
uniq zips.txt
count zips.txt
cat zips.txt | uniq -c
A: A. The file needs to first be sorted to group common ZIP codes together. After that, piping the output to uniq will display the unique ZIP codes, and the -c option provides a count.

Q: When using Bash, how would you execute the last command starting with a certain string, even if that command was not the last one that you typed?
Precede the command with ! and then the string to search for.
Search for the command in history.
Precede the command with a ? and then the string to search for.
This is not possible with Bash.
A: A. Preceding the command with a ! will search history and execute the specified command. For example, !vi will start your last Vi session.

Q: Which command can be used to kill all processes by using their name?
killproc
killname
killall
kill -f
A: C. The killall command is used to terminate processes using their name.

Q: You’re working with a large file in Vi and need to search for instances of a string earlier in the file. Which key will search backward in the file?
/
h
?
x
A: C. The ? key will search backward in a file within Vi. The / is used for searching forward. The h key moves the cursor to the left one character, and the x key will delete a character.

Q: You need to declare a local environment variable that will then be available to child processes. Which of the following commands accomplishes this task?
ex
echo
dec
export
A: D. The export command makes an environment variable available to subsequent child processes. The other commands shown are not valid.

Q: You are creating a Bash shell script and need to output the current script name to the current terminal. Which of the following commands accomplishes this task?
cat <CMD>
echo $0
echo $SCRIPT
echo $PS1
A: B. The echo command sends output and $0 is the parameter that contains the current script name. Of the other options, $PS1 is the shell prompt and the other two options do not exist by default.

Q: You have downloaded a file with a .gz extension. What is the most likely command that you will use to decompress this file?
unz
gunzip
hunzip
gzunzip
A: B. The gunzip command is typically used for decompressing files with a .gz extension. The other options are not valid commands.

Q: You need to remove a single file from a directory if it exists but would like to be prompted for confirmation before doing so. Which option to the rm command causes the command to prompt for confirmation?
-a
-e
-i
-o
A: C. The -i option causes rm to use interactive mode, where the command will prompt for confirmation prior to taking action. See the (1) rm man page for additional information on the other options.

Q: You need to determine files that are sized above 1GB. Which of the following commands accomplishes this task?
find / -size +1G
find / -size 10000M
find / +1M
find / -size +1B
A: A. The find command can be used for this purpose. When used with the size option, various size-related options can be used. The option +1G searches for files greater than or equal to 1GB.

Q: Which option to cpio lists the files as it is operating on them?
-l
-v
-k
-s
A: B. The -v or verbose option lists files as cpio is working with them. Of the other options, -s is swap bytes and –l is used to link files. The -k option is included for compatibility purposes.

Q: Which command is used to send contents of a bzip2 archive to STDOUT?
bzout
bzcat
bz2cat
bz2echo
A: B. The bzcat command sends output to STDOUT from a bzip2 archive.

Q: You are attempting to find more information about the jobs command; however, an Internet search was not particularly helpful because there are so many Linux-related jobs available. Additionally, you attempted to view the man page for the jobs command but it was not available. Which man page should you use to view more information on jobs?
jbs
procctl
bash
ps
A: C. The jobs command is actually a shell built-in command, meaning that more information is available by using the man page for bash itself. The other options either are not valid or will not show information about the jobs command/built-in.

Q: You need to start a process that cannot be sent or will not accept a SIGHUP signal. Which command should be used to start the process?
nosig
nohup
nokill
noproc
A: B. The nohup command can preface another command when starting so that the process or command will not accept a SIGHUP.

Q: You need to run a command periodically and examine its output in real time. Which of the following commands enables this scenario?
mon
procmon
pgrep
watch
A: D. The watch command runs a command repeatedly and displays the output and errors from the command. The pgrep command does not fulfill the needs of this scenario. The mon and procmon commands are not real.

Q: You would like to tail a log file to watch entries as they are being added to the log file. In addition, you would also like to work within the same terminal window or SSH (Secure Shell) session to add entries to another file at the same time. Which command can be used to create two sessions within the same terminal window?
screen
tmux
sess
termse
A: B. The tmux command creates two (or more) sessions within the same physical terminal window and thus enables this scenario. The screen command can be used to create an additional session, but the screen command does not meet the criteria specified in this scenario, because the scrollback buffer does not capture enough lines by default. The other commands shown are not valid.

Q: You need to kill several processes at once. Rather than writing a complex ps-based command to do so, you can use which other command?
pkill
psk
pskill
prock
A: A. The pkill command can be used for the scenario described. The other options are not valid commands.

Q: You are using pgrep to find the process IDs for a given command. However, several other commands seem to also appear. Which option to pgrep enables matching against the full path of the process?
-f
-d
-o
-i
A: A. The -f option matches against the full path. The -d option is used to set the delimiter, the -o option matches the oldest process, and the -i option sets the search to be case insensitive.

Q: You need to determine the exact command that will be run based on your current environment settings. Which command is used for this purpose?
what
which
find
ls
A: B. The which command is used to determine the command that will be run based on the current environment settings such as the path. The find and ls commands will not work for this purpose.

Q: An environment variable has been set on login, but you need to remove that variable temporarily for the current session. Which shell built-in command can be used for this purpose?
reset
unset
undo
clear
A: B. The unset shell built-in is used for the purpose described. Both the reset and clear commands do not accomplish the task described, and there is no undo command.

Q: You cannot find the man page of a command but you know the command exists. For example, the alias command exists but there is no man page for it. Which of the following commands could you execute to determine what type of command alias is?
type
cmd
uses
listr
A: A. The type shell built-in displays information about a given executable. For example, the command type alias shows that alias is a shell built-in as well.

Q: Which type of quotes are used so that variables are interpolated within a Bash shell script?
Escaped quotes
Single quotes
Double quotes
Side quotes
A: C. Double quotes help to ensure that variables are interpolated within a shell script. Runquotes are not used for this purpose, and the other options are not valid types of quotes.

Q: Which of the following pagers includes the ability to search backward and forward as well as move backward and forward, line-by-line, and page-by-page?
more
mplus
less
catch
A: C. The less pager fits the scenario described. The more pager does not have as much flexibility as less. The other options shown are not valid.

Q: You have a specialized need for outputting a file in octal format. Which command or series of commands can be used for this purpose?
oct
cat <file> | octalf
od
octf
A: C. The od command converts a file to octal format. The other options shown all have invalid commands.

Q: Which option to sha256sum causes the file to be read in binary mode?
-i
-b
-c
-p
A: B. The -b option for sha256sum and sha512sum reads the file in binary mode as opposed to text mode, which is the default.

Q: When operating in command mode, which keys enable you to move the cursor in the Vi editor?
a, s, d, f
h, j, k, l
q, w, e, r
z, x, c, v
A: B. The h, j, k, and l keys enable movement of the cursor in command mode Vi.

Q: Which options to xz are functionally equivalent to the xzcat program?
decompress and output
output and format
decompress and stdout
stdout and format
A: C. The decompress and stdout options to xz are functionally equivalent to the xzcat program. There is also a related program called zcat for outputting files compressed with gzip to STDOUT.

Q: Which environment variable is used to control the default text editor used on a Linux system?
EDITOR
EDIT
TEXTEDITOR
DEFAULT_EDITOR
A: A. The EDITOR environment variable controls the editor that is used. Typical choices include nano, Emacs, Vi or enhanced Vi, known as Vim.

Q: You need to examine the seventh section of the manual page for regular expressions, or regex, on a Linux system. Which command displays the seventh section of the manual?
man regex -7
man regex 7
man --page 7 regex
man 7 regex
A: D. The seventh manual section for regex is found by specifying the level after the command and prior to the manual page to examine.

Q: Which of the following commands reprioritizes an already running process?
nice
renice
chnice
altnice
A: B. The renice command changes the priority of a running process. The nice command is not capable of altering running processes, and the other commands shown are not valid.

Q: The fgrep command is equivalent to running the grep command with which option?
-f
-F
-a
-E
A: B. The fgrep command is equivalent to running the grep command with an -F option. The -f option specifies a file, and the -E option utilizes an extended regular expression and is equivalent to the egrep command. The -a option is important in its own right and causes grep to process a binary file as if it were a text file.

Q: Which of the following regular expressions would find the pattern Steve or steve in a file when used with grep?
'[sS]teve'
'[S]*teve'
'^[Ss]teve'
'[$Steve]'
A: A. All of the options shown use regular expressions. In the correct answer, the strings Steve and steve will match due to the use of a character class. Option B would match only Steve but, due to the quantifier *, would also match strings like Siwejfiwjfheteve. Option C uses anchoring and thus would only match Steve or steve at the beginning of a line. Option D also uses an anchor to indicate end of line and thus does not make sense in this context.

Q: Which of the following commands shows the currently running processes and their resource usage in real time, updated every few seconds?
nice
ps
top
procs
A: C. The top command shows running processes, typically sorted by CPU usage and updates every few seconds. The ps command shows processes but does not auto-update. The nice command sets priority, and there is no procs command.

Q: You have been asked to create a compressed file that will be readable by those with other operating systems. Which tool can you use for this purpose?
gzip
bzip2
xz
tar
A: A. Files compressed with the gzip utility can typically be read by other operating systems, though it may require additional software for certain operating systems. Compression utilities like bzip2 and xz almost certainly require additional software. The tar command in option D is not a compression utility.

Q: You need to match files that begin with 201, as in 2017, 2018, 2019. Which of the following wildcard specifications can be used?
201?
201$
201@
201]
A: A. The question mark can be used as a wildcard for such a scenario. An asterisk would also work for file globbing.

Q: You need to break a large file into smaller pieces. Which command can be used for this purpose?
cut
split
dice
rem
A: B. The split command can break up a file into multiple pieces. The cut command would split an individual line but does not meet the criteria in this scenario. There is no dice or rem command.

Q: When examining the output from top, you see that a process has a value in the PR column of 20. To what does the PR column refer?
The process ID
The process utilization
The process priority
The processor core on which the process is executing
A: C. The scheduling priority of the process is shown in the PR column. The process ID is displayed in the PID column. The top command shows CPU utilization in the %CPU column and does not display information about the processor cores.

Q: You need to cut or remove eight lines from a file while editing with Vi. Which combination should be used for this purpose?
d7
d8
r8
x7
A: A. The d key will be used for this and the number 7 used in order to cut or remove eight lines. Other keys to work with text for cut, copy, and paste in Vi include p, y, dd, and yy. The other options shown for this question are not valid.

Q: Which command is used in order to decompress a file that has been compressed with xz?
unxz
dexz
xzu
u2xz
A: A. The unxz command decompress a file that has been compressed with xz.

Q: Which of the following commands uses 128-bit message digests?
sha256sum
sha512sum
sh128sum
md5sum
A: D. The md5sum command creates a 128-bit MD5 message digest. The sha256sum command produces 256-bit values, whereas sha512sum produces 512-bit values.

Q: You have several files that need to be combined, with a line from each file being appended onto a single line. Which command can be used for this purpose?
paste
comb
appfile
combo
A: A. The paste command fits the scenario described and separates the lines from each file by a tab. The other commands are not valid.

Q: You need to run a command that is not inside your current path. Which of the following represents the typical method for doing so?
Use a fully qualified path for the command.
Set the PATH environment variable to include the correct path.
Restart the shell environment.
Restart the computer for settings to take effect.
A: A. Using a fully qualified path meets the scenario in the most typical manner. You could add the command path to the PATH environment variable, but that is unnecessary given the scenario. Restarting the shell or computer would not have any effect.

Q: Which signal is used by default by the pkill command?
SIGKILL
SIGTERM
SIGHUP
SIGKS
A: B. The SIGTERM signal is used by default by the pkill command. This can be changed using the --signal option.

Q: You are working with the jobs built-in command to display jobs. You would like to see only running jobs. Which option to the jobs built-in command will display only running jobs?
-s
-a
-l
-r
A: D. Running jobs are listed with the -r option. The -s option displays only stopped jobs, whereas -l shows process IDs. There is no -a option to the jobs built-in command.

Q: Which option to the bunzip2 command sends output to STDOUT, much like the bzcat command?
-s
-o
-c
-d
A: C. The -c option outputs to STDOUT. See the bzip2(1) man page for additional details.