Linux Administration - Exam 2
Which of the following results would be created by the command sequence: echo 'apple banana carrot dog elephant' | while read a b c; do echo result: $c $b $a; done a. carrot dog elephant apple banana b. apple banana carrot dog elephant c. elephant dog carrot d. carrot dog elephant banana apple
carrot dog elephant banana apple
Which of the following will display the contents of the /etc/shadow file? (Choose all that apply.) cat /etc/shadow getent /etc/shadow read /etc/shadow show /etc/shadow
cat /etc/shadow getent /etc/shadow
Which of the following commands will display the current CPU(s) detected by a Linux system? cat /var/log/boothw.log cat /sys/cpuinfo cat /etc/cpu.conf cat /proc/cpuinfo
cat /proc/cpuinfo
Which of the following will show account aging information for a user such as the date of the last password change, when the password expires, and the number of days of warning before the password expires? chage -u jsmith chage -l jsmith usermod --expiry jsmith lsuser jsmith
chage -l jsmith
Select the command that can be used to change the root filesystem to a different directory, such as when you are in a rescue environment. change_root croot set_root chroot
chroot
Which of the following commands will show the current user cron jobs that have been created for the currently logged in user?
crontab -l
You have run the top command successfully, but realize that the q key on the keyboard has suddenly stopped working. What is another way that you can exit out of the top program? ctrl-w ctrl-q ctrl-c ctrl-x
ctrl-c
Which of the following commands can be used to pause a printer named Printer1? cupsdisable -c Printer1 cupsreject -p Printer1 cupsreject Printer1 cupsdisable Printer1
cupsdisable Printer1
Which of the following commands should you use to specify that you want to use Git for version tracking on them? git version git add git track git new
git add
Which of the following options can be used with the usermod command to change the description of the user account that is stored in the GECOS field? -g -s -c -d
-c
The System Log Daemon, rsyslogd, creates a socket for other system processes to write to. What is the path to this socket? /etc/rsyslog.socket /dev/log /var/log.sock /tmp/log
/dev/log
A system administrator wants to allow most users to be able to run cron jobs, but wants to specifically prevent a couple of users from doing so. Which of the following files could the administrator edit to disallow these users from creating cron jobs? /etc/cron.allow /etc/cron.d/cron.allow /etc/cron.deny /etc/cron.d/cron.deny
/etc/cron.deny
In which directory would a system administrator store scripts that should be run monthly by the cron daemon? /etc/crontab/monthly /var/crontab/monthly /var/cron/monthly /etc/cron.monthly
/etc/cron.monthly
Which of the following files is where the default runlevel is set on some Linux systems?
/etc/inittab
Which of the following files is a binary file that contains the rules for calculating the time based on your time zone relative to epoch time? /usr/local/bin/timecalc /etc/localtime /sbin/tickadj /sbin/timeadj
/etc/localtime
What is the path to where the journald.conf file is located? /etc/systemd/journald.conf /etc/rsyslog/journald.conf /etc/journald/journald.conf /etc/rsyslogd/journald.conf
/etc/systemd/journald.conf
Which of the following represents stderr at the command line when used for redirection?
2
Which of the following accessibility features simulates simultaneous key presses when two keys are pressed in sequence?
Sticky Keys
Which of the following is a valid Linux initialization process?
SystemdSysV
Which of the following is responsible for starting tasks and services during boot, stopping them during shutdown, and supervising them while the system is running? Kickstart Upstart GRUB POST
Upstart
What is contained in the DISPLAY variable on a Linux system running the X window system?
Which X server the client is supposed to connect to by default.
Which of the following is a lightweight desktop environment that uses very few system resources that a system administrator might choose to install on a Linux server instead of one of the two main desktop environments?
XFCE
What is the term for a ZFS managed filesystem that is created from ZFS pools? ZFS volume ZFS vault ZFS lake ZFS store
ZFS volume
Which of the following is the common escape sequence to display a horizontal tab using the echo command? %tab ?tab \tab \t
\t
A system administrator wants to schedule a task to run at 11 pm, but knows that she will not be in the office at that time. Which of the following commands can she use to schedule this task to run that night while she is at home?
at
Which of the following commands will send the output of the cat command to the grep command to be filtered?
cat /etc/passwd | grep jsmith
Which of the following commands will display the number of seconds that have elapsed since January 1, 1970? date +%s date --epochdiff datetime --epoch datetime -s
date +%s
Which of the following commands can be used to remove a group from a Linux system? (Choose all that apply.) rmg delgroup rmgroup groupdel
delgroup groupdel
Which of the following is a type of software that allows a piece of hardware to host multiple operating systems? hypervisor guest operating system thick client thin client
hypervisor
Which of the following commands can be used to convert files between different character encodings?
iconv
Which of the following commands can be used to set the default printer for all users on a Linux system where printer1 is the name of the printer? lpq --set-default printer1 lpoptions -d printer1 lpd -d printer1 lp -d printer1
lpoptions -d printer1
Which of the following commands can you use to send a print job to printer1? (Choose all that apply.) lpr -P printer1 mydocument.txt lp -p printer1 mydocument.txt lpr -d printer1 mydocument.txt lp -d printer1 mydocument.txt
lpr -P printer1 mydocument.txt lp -d printer1 mydocument.txt
Which of the following commands will display the print jobs in the print queue for printer1 only? lpstat -o printer1 lpq -p printer1 lp -j printer1 lpq -d printer1
lpstat -o printer1
Which of the following commands can be used to display general hardware information for the entire system? lscpu lshw hwdisp hware
lshw
Which of the following can be included in a shell script to ask the user to type in a password and then store it in the variable named $password? read -s -p "Please enter the password: " password read -s -p "Please enter the password: " $password read -p "Please enter the password: " $password read -p -s "Please enter the password: " password
read -s -p "Please enter the password: " password
Which of the following commands will prompt you to answer a series of questions to help determine which time zone file you should use?
tzselect
Which of the following characters can be entered at the beginning of a line in a shell script to ensure that line is recognized as a comment rather than try to execute it?
#
What option can be used with the ps command to display an entire list of processes across all Terminals, including daemons? -a -e -f -l
-e
Which of the following entries could be added to the rsyslog.conf configuration file to have all syslog messages displayed to console 10?
. /dev/tty10
In which file can you configure rules for logging on a Linux system?
/etc/rsyslog.conf
In which of the following directories can you place files that will be copied to new user directories when new users are created?
/etc/skel
What file in the /proc directory contains information about a computer's CPU? /proc/proc_info /proc/meminfo /proc/cpuinfo /proc/cpu_info
/proc/cpuinfo
To ensure that Linux has detected the correct amount of RAM in the system after installation, you should view the contents of what file in the proc directory? /proc/mem /proc/cpuinfo /proc/meminfo /proc/meoryinfo
/proc/meminfo
Where are the files stored that contain information for all of the time zones that could be recognized by a Linux operating system? /etc/timezones Incorrect. There is not an /etc/timezones directory on the Linux operating system. /var/zoneinfo /usr/share/zoneinfo /var/local/timezones
/usr/share/zoneinfo
Which of the following files stores information about failed logins on a Linux system? /var/log/btmp /var/log/failed /var/log/nolo /var/log/wtmp
/var/log/btmp
Where are scheduled commands stored on Ubuntu Linux systems? /tmp/at /etc/at/ /var/spool/cron/atjobs /var/spool/at
/var/spool/cron/atjobs
Which of the following would be the results of running the command seq 7? 6 through 0 being displayed one number per line. 1 through 7 being displayed one number per line. 0 through 6 being displayed one number per line. 7 through 1 being displayed one number per line.
1 through 7 being displayed one number per line.
Which of the following is the highest value that can be set for the nice value which would result in a greater chance of a lower priority? 20 10 19 0
19
Which of the following can be used for comparing values within an if statement? (Choose two.) -grt = -lt -neq
= -lt
Which of the following will take output from a command and append it to the end of a file? < << >> >
>>
Which of the following commands can be used to create a BASH variable named CREATOR with the value of Torvalds?
CREATOR="Torvalds"
Which of the following is the default desktop environment used by Linux Mint?
Cinnamon
If a process state is currently showing as uninterruptible sleep, which letter will show in the output of the ps command?
D
Which of the following is an on-screen keyboard used with Linux?
GOK
Which of the following will the split command do on a file when no other options are specified? It will split a file into new files that are 1,000 lines each. It will split a file into new files that are 1 kilobyte each. It will split a file into new equally sized files that are 1/10th of the original file size. It will split a file into new files that are 1 megabyte each.
It will split a file into new equally sized files that are 1/10th of the original file size.
Which of the following options is passed to the Linux kernel from the GRUB2 configuration file to set the locale?
LANG
Which of the following environment variables can you change the value of to set the default printer on a Linux system? (Choose two.) LPDEST LPDEFAULT PRINTER PRINT
LPDEST PRINTER
Which kill signal terminates a process by taking the process information in memory and saving it to a file called core on the hard disk in the current working directory?
SIGQUIT
Which of the following does Click Assist do? Simulates a right click by holding down the left mouse button. Simulates a right click by holding down the Ctrl key on the keyboard. Simulates a left click by holding down the left shift key or a right click by holding down the right shift key. Reads the text for buttons on the screen so the user knows what they may be clicking on.
Simulates a right click by holding down the left mouse button.
Which of the following system variables can you modify to override the default system timezone within your current shell?
TZ
Which of the following system variables can you modify to override the default system timezone within your current shell? TZ TIME LOCALE LC_TZ
TZ
Which of the following does a Linux kernel use to store the value of epoch time? The number of days since January 1, 1900 The number of minutes since January 1, 1900 The number of seconds since January 1, 1970 The number of milliseconds since January 1, 1980
The number of seconds since January 1, 1970
Levi wants to run 5 commands sequentially, but does not want to create a shell script. He knows that each command is going to take approximately 20 minutes to run individually. However, he would like to go to lunch 15 minutes from now. He knows that he can type all of the commands on the same line and separate them with a certain character to run them sequentially. Which character can he type after each command to have them run one after the next without requiring further input from him? a semicolon a colon a pound sign a comma
a semicolon
Which command can be used to create a new command that will monitor the contents of auth.log as they get added to the file? alias showauth='tail -f /var/log/auth.log' ln showauth='tail -f /var/log/auth.log' create showauth='tail -f /var/log/auth.log' new showauth as 'cat -f /var/log/auth.log'
alias showauth='tail -f /var/log/auth.log'
Which of the following commands will display a list of the pending jobs to be run? (Choose all that apply.) at -d at -l atq at -q
at -l atq at -q
Which of the following files holds the configuration information for GRUB Legacy on Ubuntu Linux systems?
menu.lst
Which command should you run after installing a new kernel module to update the module dependency database? depmod insmod lsmod modprobe
depmod
Which of the following commands will display messages that were displayed during the boot sequence by the kernel?
dmesg
Which of the following is the log file where Dandified YUM writes its log entries? dyum.log dnf.log yumd.log dnf.rpm.log
dnf.rpm.log
Which of the following is the log file where the Debian Package Manager writes entries for actions taken and packages installed?
dpkg.log
Which of the following commands will display the exit status of the last command used in the BASH shell? echo $exit echo $status echo $? echo $!
echo $?
You have just created a variable named CREATOR. Which of the following commands will display the contents of the variable to standard output?
echo $CREATOR
After a background process has been started, what command below can be used to move it to the foreground? fg fgnd b2f fgd
fg
When writing shell scripts and using an if statement to determine whether a set of code should be executed, what is the proper syntax to end the if construct?
fi
Which command can be used to download an updated copy of the master branch from the original Git repository? git pull original master git pull master origin git pull origin master git pull master original
git pull origin master
Which of the following files can you add filenames to so that the git add * command will not stage them?
gitignore
Which of the following will look at the /etc/passwd file for any lines containing the word root and display them out to the screen while simultaneously writing the results to a file?
grep root /etc/passwd | tee ~/root.txt
Which of the following can be used to compare the hardware clock to the system clock, writing a new result to a new line every 10 seconds?
hwclock -c
Which of the following constructs can be used in a shell script to determine whether two values are equal and if so run another set of commands?
if
What file in the /proc directory contains a list of memory address ranges reserved for device use? iomem misc meminfo ioports
ioports
Which of the following commands can be used to only show jobs that have been paused. jobs -s jobs -r jobs -p jobs -n
jobs -s
Which of the following commands can you use to view events within the journald database? journal --display journald --list journalctl viewlogs --journald
journalctl
In Fedora 20, what journaling database system has replaced the logging system used to record the messages normally stored within the boot.log, messages, and syslog files?
journald
Which of the following log files contains information and error messages generated by the Linux kernel? kern.log wtmp secure dmesg
kern.log
Which of the following will invalid entries in the GRUB2 configuration cause? kernel warning automatically skipping invalid entries kernel panic and halt the system kernel error with confirmation to skip invalid entries no error, automatically skipping invalid entries until a valid entry is found
kernel panic and halt the system
Which of the following commands will send a process's resources to /dev/null to kill the process for process ID 1357? kill -9 1357 sigkill 1357 kill -15 1357 killall 1357
kill -9 1357
In order to create and manage KVM or Qemu virtual machines, a Linux system must have which of the following installed? libvert libvm library. vmlib virsh
libvert
Which of the following commands will show a number of environment variables that start with LC_? localvar locale env printenv
locale
Which of the following commands can be used to display the current locale of a system?
locale localectl
Which of the following two commands can be used to add custom log file entries to the journald database? (Choose two.) logger systemd-cat mklog systemd-make logentry
logger systemd-cat
Which of the following commands can be used to see files that are currently being used by a specific process ID (PID)? psfiles pids pstatus lsof
lsof
A government office wants to secure a few of its Linux systems so that they can only use certain USB devices. After plugging in a USB device, which of the following commands could be used to detect certain identifying information that can be used to only allow that type of USB device? modusb usbdetect lspci lsusb
lsusb
Which of the following commands can be used to create and manage a software RAID configuration after installation? raidadm dmadm madam mdadm
mdadm
The subdirectory newdir does not currently exist in the current directory that you are in. Which of the following commands will create a new directory named newdir and then change into that directory?
mkdir newdir && cd newdirmkdir newdir; cd newdir
Which of the following commands will generate a new initramfs? mkinitrd mkinit dracut cutram
mkinitrd dracut
Leonard wants to find detailed information about the Bluetooth kernel module. Which of the following commands can he use to display this information?
modinfo bluetooth
What file under the proc directory contains information regarding what modules are currently loaded into the Linux kernel?
modules
Which of the following is the default window manager used by the GNOME version 3 desktop environment? mutter metacity wmaker kwin
mutter
Which of the following commands will display the output of a file while also displaying a line number at the left side of each line for the /etc/passwd file? nl /etc/passwd numbers /etc/passwd ln /etc/passwd wc -l /etc/passwd
nl /etc/passwd
Which of the following virsh commands will display the total amount of memory as well as the amount of free memory for a node?
nodememstats
Which of the following can be used preceding a command to prevent a process from terminating when the parent process terminates?
nohup
Which of the following commands can be used to terminate a process by the process name? stop pskill pkill kill
pkill
Which of the following commands will show a list of process names along with their process ID (PID)?
ps, top
What command is used to display the lineage of a process by tracing its PPIDs until the init daemon? pshead pstree psparent psbranch
pstree
Which of the following characters, when pressed while the top program is running, will allow you to change the niceness of a process? r p d n
r
Which of the following commands will show the current runlevel along with the previous runlevel? (Choose all that apply.) runlevel telinit -r init -r echo $RUNLEVEL
runlevel
If a Linux installation ends abnormally and the screen displays a fatal signal 11 error, what type of error has occurred?
segmentation fault
Which of the following commands will count down from 10 to 1? seq 10 1 seq 10 -1 1 seq 10 -1 seq 10 1 -1
seq 10 -1 1
Which of the following commands will display the contents of the /etc/passwd file in alphanumerical order?
sort /etc/passwd
Which of the following is a virtual filesystem that is made up of virtual files that a Linux operating system is able to export information to about kernel sub-systems, hardware devices, and device drivers to make it easy for users to access the information? varfs procfs sysfs tmpfs
sysfs
Which of the following commands will set the default runlevel of a Linux system? systemctl --set-default runlevel5.target systemctl set-default runlevel5.target systemctl --default runlevel5.target systemctl set-init runlevel5.target
systemctl set-default runlevel5.target
Each SCSI device attached to a system must be assigned an ID number. What is this ID number called?
target ID
Which of the following commands will shut down a Linux system?
telinit 0 shutdown -h now poweroff
Which of the following commands will list the time zones available on a Linux system?
timedatectl list-timezones
Which of the following options can be specified in the GRUB Legacy configuration file to set how long the boot menu is displayed before loading the default image?
timeout
Which of the following commands will prompt you to answer a series of questions to help determine which time zone file you should use? zones timezones zoneselect tzselect
tzselect
An alias has previously been created named showauth. Which of the following commands can be used to get rid of that alias? alias -d showauth noalias showauth unalias showauth ualias shoauth
unalias showauth
How many times will the following loop execute as part of a script: #!/bin/bash COUNTER=0 while [ $COUNTER -lt 7 ] do echo "hello world" done
until ctrl-c is used to terminate it
Which of the following commands can be used to set the number of days until user account jsmith with an expired password is disabled? usermod -f 15 jsmith usermod -d 15 jsmith usermod -x 15 jsmith usermod -e 15 jsmith
usermod -f 15 jsmith
Which of the following is the first field of the /etc/passwd file?
username
On a system using the KVM hypervisor, which of the following modules would you expect to see as part of the output of the lsmod command on a guest Linux virtual machine? vmw hyperv_ hv_ virtio
virtio
Which of the following commands can be used to schedule very frequent recurring tasks, such as running once every minute? run while do watch
watch
Which of the following commands will count the number of lines in a file named data.csv? wc -l data.csv count -l data.csv lines data.csv lc data.csv
wc -l data.csv
Which of the following is a special group that provides its members with the ability to run the su and sudo commands?
wheel
Using the syntax below, what command will create directories named one, two, and three? echo one two three | ___________ mkdir
xargs
Which of the following states describe a process that is waiting for a parent process to release its PID? wait dead zombie suspended
zombie
If incompatible X Windows settings are configured, where will the errors that are generated be written to? ~/.xsession-errors ~/.xerror ~/.xwin-error /var/log/xwindows.error
~/.xsession-errors