Print
Category: Answers
Hits: 1318

LPIC 101-500

GNU and UNIX Commands exam

 

  Take the test here (You need an account. It's free)

 

1.    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?
A.    setoutput -f
B.    overwrite=no
C.    overwrite -n
D.    set -C

ANSWER: 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.


2.    What command can be used to view the current settings for your environment when using Bash?
A.    environment
B.    env
C.    listenv
D.    echoenv

 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.


3.    Which command is used to access documentation on the Linux computer for a given command?
A.    doc
B.    heredoc
C.    man
D.    manual

 C. The man command displays documentation for the command given as the argument. The other options listed for this question do not exist.


4.    Which of the following commands will print various information about the kernel and architecture, along with other details?
A.    info -sys
B.    man sys
C.    sysinfo
D.    uname -a

 D. The uname command is used to print system information, and the -a option prints all information available to uname.


5.    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?
A.    y
B.    g
C.    a
D.    r

B. 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.


6.    Which option for the wc command prints the number of lines given as input?
A.    -f
B.    -a
C.    -l
D.    -o

 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.


7.    What is the default number of lines printed by the head and tail commands, respectively?
A.    10 for head, 5 for tail
B.    5 for head, 10 for tail
C.    10 for both head and tail
D.    3 for both head and tail

 C. Both head and tail print 10 lines of output by default.


8.    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?
A.    rm -f
B.    rm -rf
C.    rmdir -a
D.    rmdir -m

 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.


9.    Which command will find directories with names beginning with 2014 located beneath the current directory?
A.    find ./ -name "2014"
B.    find ./ -type d -name "2014"
C.    find / -type d "2014"
D.    find ./ -type d -name "2014*"

 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.


10.    Which of the following commands will provide the usernames in a sorted list gathered from the /etc/passwd file?
A.    cat /etc/passwd | awk -F : '{print $1}' | sort
B.    sort /etc/passwd | cut
C.    echo /etc/passwd
D.    cat /etc/passwd | awk '{print $1}' | sort

 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.


11.    Which options to is 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?
A.    -la
B.    -lat
C.    -latr
D.    -itr

     C. The -l option for is 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.


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

     A. The time stamp of the file will change when touch is run on a file that already exists.


13.    Which option to both mv and cp will cause the command to prompt before overwriting files that already exist?
A.    -f
B.    -z
C.    -r
D.    -i

 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.


14.    Which of the following commands will send the contents of /etc/passwd to both STDOUT and to a file called passwordfile?
A.    cat /etc/passwd > passwordfile
B.    var /etc/passwd | passwordfile
C.    cat /etc/passwd | tee passwordfile
D.    echo /etc/passwd | stdout > passwordfile

 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.


15.    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?
A.    mkdir -p /usr/local/test/october
B.    mkdir /usr/local/test/october
C.    mkdir -r /usr/local/test/october
D.    mkdir -f /usr/local/test/october

 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.


16.    Which option to the cp command will copy directories in a recursive manner?
A.    -v
B.    -R
C.    -z
D.    -i

 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.


17.    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?
A.    grep
B.    telnet
C.    file
D.    export

 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.


18.    Which command will create an image of the /dev/sda1 disk partition and place that image into a file called output. img?
A.    dd if=sda of=/dev/sda1
B.    dd if=output.img of=/dev/sda1
C.    dd if=/dev/sda1 of=output.img
D.    echo /dev/sda1 > output.img

 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.


19.    What is the default delimiter used by the cut command?
A.    Colon
B.    Tab
C.    Space
D.    Comma

 B. The cut command uses Tab as its default delimiter. This can be changed with the - d option.


20.    Which of the following will unzip and extract the contents of a file that has been tarred and gzipped?
A.    tar -zxf <file.tgz>
B.    tar -xf <file.tgz>
C.    tar -vz <file.tgz>
D.    tar -fd <file.tgz>

 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.


21.    What command is used to bring a command to foreground Processing after it has been backgrounded with an &?
A.    bg
B.    fore
C.    4g
D.    fg

 D. The fg command will bring a command to the foreground if it has been backgrounded with either & or with the bg command.


22.    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?
A.    ps auwx | grep apache
B.    pgrep apache
C.    processlist apache
D.    Is -p apache

 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.


23.    Which of the following command lines would monitor a single process called nagios in a continuous manner?
A.    top -n 1
B.    top -p 23
C.    ps -nagios
D.    top -p'pidof nagios'

 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.


24.    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?
A.    tree
B.    pgrep
C.    uptime
D.    free

 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.


25.    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?
A.    :wq
B.    :q!
C.    dd
D.    x

 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.


26.    What option is used to change the number of lines of output for the head and tail commands?
A.    -l
B.    -f
C.    -g
D.    -n

 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.


27.    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?
A.    uptime
B.    sysinfo
C.    bash
D.    ls -u

 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 is command will not display the required information.


28.    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?
A.    fg
B.    bg
C.    kill
D.    screen

 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.


29.    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?
A.    -15
B.    -f
C.    -9
D.    -stop

 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.


30.    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?
A.    1>2
B.    >2
C.    2>&1
D.    >>

 C. Within Bash, the number 1 represents STDOUT and 2 represents STDERR. Redirecting both means combining them in the manner shown in option C.


31.    Which command can be run to determine the default priority for processes spawned by the current user?
A.    prio
B.    nice
C.    renice
D.    defpriority

 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.


32.    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?
A.    grep sh /etc/passwd
B.    egrep '/*/.sh$' /etc/passwd
C.    grep '/*/.=sh$' /etc/passwd
D.    egrep '/*/..?sh$' /etc/passwd

 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.


33.    Which option to the man command accesses a different level of documentation, for example, system call documentation?
A.    man 2 <argument>
B.    progman <argument>
C.    man -sys <argument>
D.    man -list sys

 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.


34.    When editing with Vi, which command changes to insert mode and opens a new line below the current cursor location?
A.    f
B.    a
C.    o
D.    i

 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.


35.    Which kill signal can be sent in order to restart a process?
A.    -HUP
B.    -RESTART
C.    -9
D.    -SIG

 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.


36.    Which of the following commands will display the last 50 lines of your command history when using Bash, including commands from the current session?
A.    bashhist 50
B.    history 50
C.    cat .bash_history
D.    tail -f .bash_history

 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.


37.    You have backgrounded several tasks using &. Which command  can be used to view the current list of running tasks that have been backgrounded?
A.    procs
B.    plist
C.    jobs
D.    free

 C. The j obs built-in command shows the list of jobs running in the background. Its output includes a job number and the status of the job.


38.    Which of the following commands searches each user’s  .bash_history file to determine whether the user has invoked the sudo command?
A.    find /home -name "bash_history" | grep sudo
B.    find /home -name ".bash_history" | xargs grep sudo
C.    find /home/.bash_history | xargs grep sudo
D.    find /home -type history | xargs grep sudo
 

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.


39.   Which command will watch the Apache log at /var/log/httpd/access.log and continually scroll as new log entries are created?
A.    watch /var/log/httpd/access.log
B.    tail /var/log/httpd/access.log
C.    tail -f /var/log/httpd/access.log
D.    mon /var/log/httpd/access.log

 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.


40.    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?
A.    lines
B.    wc -l
C.    newline
D.    nl

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.


41.    You receive a file with an .lzma extension. Which command can you use to decompress this file?
A.    xz
B.    lz
C.    gz
D.    bzip

 A. The xz command can compress and decompress files in a variety of formats, one of which is lzma.


42.    Which find command will locate files within the current directory that have been modified within the last 24 hours?
A.    find    ./    -type    f    -mtime    0
B.    find    ./    -type    f    -mtime    24
C.    find    ./    -type    f    -mtime    +1
D.    find    ./    type -f    time 24

 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.


43.    Which command will move all files with a .txt extension to the /tmp directory?
A.    mv txt* tmp
B.    move *txt /temp
C.    mv *.txt /tmp
D.    mv *.txt tmp

 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.


44.    Which command prints your current directory?
A.    cwd
B.    curdur
C.    cd
D.    pwd

 D. The pwd command prints the current working directory. The cd command changes directory.


45.    Assume that you have a file called zips.txt that contains several postai 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?
A.    sort zips.txt | uniq -c
B.    uniq zips.txt
C.    count zips.txt
D.    cat zips.txt | uniq -c

 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.


46.    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?
A.    Precede the command with ! and then the string to search for.
B.    Search for the command in history.
C.    Precede the command with a ? and then the string to search for.
D.    This is not possible with Bash.

 A. Preceding the command with a ! will search history and execute the specified command. For example, ! vi will start your last Vi session.


47.    Which command can be used to kill all processes by using their name?
A.    killproc
B.    killname
C.    killall
D.    kill -f

 C. The killall command is used to terminate processes using their name.


48.    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?
A.    /
B.    h
C.    ?
D.    x

 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.


49.    You need to declare a local environment variable that will then be available to child processes. Which of the following commands accomplishes this task?
A.    ex
B.    echo
C.    dec
D.    export

 D. The export command makes an environment variable available to subsequent child processes. The other commands shown are not valid.


50.    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?
A.    cat <CMD>
B.    echo $0
C.    echo $SCRIPT
D.    echo $PS1

 B. The echo command sends output and $0 is the parameter that contains the current script name. Of the other options, $PSI is the shell prompt and the other two options do not exist by default.


51.    You have downloaded a file with a . gz extension. What is the most likely command that you will use to decompress this file?
A.    unz
B.    gunzip
C.    hunzip
D.    gzunzip

 B. The gunzip command is typically used for decompressing files with a . gz extension. The other options are not valid commands.


52.    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.    -a
B.    -e
C.    -i
D.    -o

 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.

 
53.    You need to determine files that are sized above 1GB. Which of the following commands accomplishes this task?
A.    find    /    -size    +1G
B.    find    /    -size    10000M
C.    find    /    +1M    
D.    find    /    -size    +1B

 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.


54.    Which option to cpio lists the files as it is operating on them?
A.    -l
B.    -v
C.    -k
D.    -s

 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.


55.    Which command is used to send contents of a bzip2 archive to STDOUT?
A.    bzout
B.    bzcat
C.    bz2cat
D.    bz2echo

 B. The bzcat command sends output to STDOUT from a bzip2 archive.


56.    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?
A.    jbs
B.    procctl
C.    bash
D.    ps

 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.

57. You need to start a process that cannot be sent or will not accept aSIGHUP signal. Which command should be used to start theprocess?
A. nosig
B. nohup
C. nokill
D. noproc

 B. The nohup command can preface another command when starting so that the process or command will not accept a SIGHUP.


58.    You need to run a command periodically and examine its output in real time. Which of the following commands enables this scenario?
A.    mon
B.    procmon
C.    pgrep
D.    watch

 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.


59.    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?
A.    screen
B.    tmux
C.    sess
D.    termse

 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.


60.    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?
A.    pkill
B.    psk
C.    pskill
D.    prock

 A. The pkill command can be used for the scenario described. The other options are not valid commands.


61.    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?
A.    -f
B.    -d
C.    -o
D.    -i

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.
 
62.    You need to determine the exact command that will be run based on your current environment settings. Which command is used for this purpose?
A.    what
B.    which
C.    find
D.    ls

 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 is commands will not work for this purpose.


63.    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?
A.    reset
B.    unset
C.    undo
D.    clear

 B. The unset shell built-in is used for the purpose described. Both the reset and ciear commands do not accomplish the task described, and there is no undo command.


64.    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?
A.    type
B.    cmd
C.    uses
D.    listr

 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.


65.    Which type of quotes are used so that variables are interpolated within a Bash shell script?
A.    Escaped quotes
B.    Single quotes
C.    Double quotes
D.    Side quotes

 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.


66.    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?
A.    more
B.    mplus
C.    less
D.    catch

 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.


67.    You have a specialized need for outputting a file in octal format. Which command or series of commands can be used for this purpose?
A.    oct
B.    cat <file> | octalf
C.    od
D.    octf

 C. The od command converts a file to octal format. The other options shown all have invalid commands.


68.    Which option to sha256sum causes the file to be read in binary mode?
A.    -i
B.    -b
C.    -c
D.    -p

 B. The -b option for sha256sum and sha5i2sum reads the file in binary mode as opposed to text mode, which is the default.


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

 B. The h, j, k, and l keys enable movement of the cursor in command mode Vi.


70.    Which options to xz are functionally equivalent to the xzcat program?
A.    decompress and output
B.    output and format
C.    decompress and stdout
D.    stdout and format

     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.


71.    Which environment variable is used to control the default text editor used on a Linux system?
A.    EDITOR
B.    EDIT
C.    TEXTEDITOR
D.    DEFAULT_EDITOR

     A. The EDITOR environment variable controls the editor that is used. Typical choices include nano, Emacs, Vi or enhanced Vi, known as Vim.


72.    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?
A.    man    regex    -7
B.    man    regex    7
C.    man    -page    7 regex
D.    man    7 regex

 D. The seventh manual section for regex is found by specifying the level after the command and prior to the manual page to examine.


73.    Which of the following commands reprioritizes an already running process?
A.    nice
B.    renice
C.    chnice
D.    altnice

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.


74.    The fgrep command is equivalent to running the grep command with which option?
A.    -f
B.    -F
C.    -a
D.    -E

 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.


75.    Which of the following regular expressions would find the pattern steve or steve in a file when used with grep?
A.    '[sS]teve'
B.    '[S]*teve'
C.    '^[Ss]teve'
D.    '[$Steve]'

 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.


76.    Which of the following commands shows the currently running processes and their resource usage in real time, updated every few seconds?
A.    nice
B.    ps
C.    top
D.    procs

 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.


77.    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?
A.    gzip
B.    bzip2
C.    xz
D.    tar

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.


78.    You need to match files that begin with 201, as in 2017, 2018, 2019. Which of the following wildcard specifications can be used?
A.    201?
B.    201$
C.    201@
D.    201]

 A. The question mark can be used as a wildcard for such a scenario. An asterisk would also work for file globbing.


79.    You need to break a large file into smaller pieces. Which command can be used for this purpose?
A.    cut
B.    split
C.    dice
D.    rem

 B. The spiit 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.


80.    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?
A.    The process ID
B.    The process utilization
C.    The process priority
D.    The processor core on which the process is executing

 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.


81.    You need to cut or remove eight lines from a file while editing with Vi. Which combination should be used for this purpose?
A.    d7
B.    d8
C.    r8
D.    x7

     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.


82.    Which command is used in order to decompress a file that has been compressed with xz?
A.    unxz
B.    dexz
C.    xzu
D.    u2xz

     A. The unxz command decompress a file that has been compressed with xz.


83.    Which of the following commands uses 128-bit message digests?
A.    sha256sum
B.    sha512sum
C.    sh128sum
D.    md5sum

 D. The md5sum command creates a 128-bit MD5 message digest. The sha256sum command produces 256-bit values, whereas sha5i2sum produces 512-bit values.


84.    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?
A.    paste
B.    comb
C.    appfile
D.    combo

 A. The paste command fits the scenario described and separates the lines from each file by a tab. The other commands are not valid.


85.    You need to run a command that is not inside your current path. Which of the following represents the typical method for doing so?
A.    Use a fully qualified path for the command.
B.    Set the PATH environment variable to include the correct path.
C.    Restart the shell environment.
D.    Restart the computer for settings to take effect.

 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.


86.    Which signal is used by default by the pkill command?
A.    SIGKILL
B.    SIGTERM
C.    SIGHUP
D.    SIGKS

 B. The SIGTERM signal is used by default by the pkiii command. This can be changed using the -signal option.


87.    You are working with the j obs 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?
A.    -s
B.    -a
C.    -l
D.    -r

 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.


88.    Which option to the bunzip2 command sends output to STDOUT, much like the bzcat command?
A.    -s
B.    -o
C.    -c
D.    -d

C. The -c option outputs to STDOUT. See the bzip2(i) man page for additional details.