Linux Single User Final Exam
Which of the following commands can be used to search for packages that contain the word oobla on RPM software repositories? yum search oobla rpm -qS oobla yum list oobla rpm -ql oobla
yum search oobla
Which option to the dpkg command can be used to list the files that comprise a package? -l -L -s -i
-L
Which filename extension indicates a tarball? .tar.gz .cpio .dump .tar
.tar.gz
Files that have been compressed using the xz utility typically have the ______ extension) .zip .gz .xz .bz2
.xz
What is the name of the file that contains a listing of all users on the system and their home directories? /etc/passwd /etc/users /etc/shadow /etc/password
/etc/passwd
Which of the following files is always executed immediately after any user logs in to a Linux system and receives a BASH shell? /etc/profile ~/.bash_profile ~/.bash_login ~/.profile
/etc/profile
Which file stores the IP addresses of the DNS servers used to resolve host names if no DNS servers are specified within the network configuration file for the network interface? /etc/hosts /etc/host.conf /etc/resolve /etc/resolv.conf
/etc/resolv.conf
Where are individual user tasks scheduled to run with the cron daemon stored on a Fedora system? A. /etc/crontab B. /etc/cron/username C. /var/spool/cron D. /var/spool/cron/username
/var/spool/cron/username
You have created a full backup and four incremental backups) In which order must you restore these backups? 0,1,2,3,4 0,4,3,2,1 4,3,2,1,0 1,2,3,4,0
0,1,2,3,4
Which of the following are stand-alone daemons? (Choose all that apply.) Apache (httpd) Washington University FTP (in.ftpd) telnet (in.telnetd) DNS (named)
Apache (httpd) DNS (named)
Consider the following shell script: echo -e "What is your favorite color?--> \c" read REPLY if [ "$REPLY" = "red" -o "$REPLY" = "blue" ] then echo "The answer is red or blue." else echo "The answer is not red nor blue." fi What would be displayed if a user executes this shell script and answers Blue when prompted? A. The answer is red or blue. B. The answer is not red nor blue. C. The code would cause an error. D. The answer is red or blue. The answer is not red nor blue.
B. The answer is not red nor blue
When you run the ps command, how are daemon processes recognized? A. Their terminal is listed as tty0 B. There is a question mark in the TTY column C. There is an asterisk in the STIME column D. There is a "d" for daemon in the terminal ID column
B. There is a question mark in the TTY column.
When a printer is disabled, ________. A. the print queue does not accept jobs and sends a message to the user noting that the printer is unavailable B. the print queue accepts jobs into the print queue and holds them there until the printer is enabled again C. the printer appears as offline when an lp request is sent D. the print queue redirects all print jobs sent to it to /dev/null
B. the print queue accepts jobs into the print queue and holds them there until the printer is enabled again
How do you indicate a comment line in a shell script? There are no comment lines in a shell script Begin the line with #! Begin the line with ! Begin the line with #
Begin the line with #
The at command is used to _______________. A. schedule processes to run periodically in the background B. schedule processes to run periodically on a recurring basis in the future C. schedule processes to run at a single instance in the future D. schedule processes to run in the foreground
C. schedule processes to run at a single instance in the future
The -9 option to the gzip utility results in a higher compression ratio) True or False?
True
The line that configures the host name for the computer at boot time can be found in /etc/hostname. True or False?
True
The sed and awk commands are filter commands commonly used to format data within a pipe. True or False?
True
You can lock a user account by changing the default login shell to an invalid shell in /etc/passwd. True or False?
True
The IP address of 127.0.0.1 is also referred to as the _____. local address lookup address local host loopback address
loopback address
Which command can be used to send a print job to the default printer named Printer1? (Choose all that apply.) lp -d Printer1 file lp Printer1 file lp file lp -m Printer1 file
lp -d Printer1 file lp file
Which command can be used to temporarily alter the primary group associated with a given user? usermod chggrp gpasswd newgrp
newgrp
Which of the following commands will most likely increase the chance of a process receiving more time slices? renice 0 renice 15 renice -12 renice 19
renice -12
Which command could you use to see a list of all environment and user-defined shell variables as well as their current values? ls /var env set echo
set
Which of the following can be used to provide a graphical remote administration? (Choose all that apply) ssh -X VNC telnet ssh
ssh -X VNC
Which of the following operators reverses the meaning of a test statement? #! -o -a !
!
Which of the following variables could access the value "/etc" within the sample shell script, if the sample shell script was executed using the bash sample /var /etc /bin command? $0 $1 $2 $3
$2
Which dump level indicates a full backup?
0
Which port number is associated with SSH? 137 22 23 49
22
What kill level signal cannot be trapped?
9
Because stderr and stdout represent the results of a command and stdin represents the input required for a command, only stderr and stdout can be redirected to/from a file. True or False?
False
The bzip2 and gzip utilities use similar compression algorithms) True or False?
False
To kill a process running in the background, you must place a % character before its process ID. True or False?
False
UIDs and GIDs are unique to the system and, once used, can never be reused. True or False?
False
As daemon processes are not associated with terminals, you must use an option such as -e alongside the ps command to view them. True or False?
True
You can clear a log file simply by redirecting nothing into it. True or False?
True
What is the term used to describe a user providing a user name and password to log in to a system? validation authorization login authentication
authentication
Which command can be used to create an image backup of a partition? tar dd dump cpio
dd
Every if construct begins with if and must be terminated with? end endif stop fi
fi
Which of the following utilities can be used to check TCP/IP configuration and test network connectivity? (Choose all that apply.) ifconfig iwconfig ping nmcli
ifconfig iwconfig ping nmcli
The daemons associated with network services listen for network traffic associated with a particular _____. station port IP address allocation number
port
Which construct can be used in a shell script to read stdin and place it in a variable? read sum verify test
read
Which one of these commands can be used to modify the route table on a Linux computer? route ipconfig ip traceroute
route
Which of the following commands can be used to list the files contained within an installed RPM package? rpm -qa packagename rpm -qi packagename rpm -ql packagename rpm -q packagename
rpm -ql packagename
Which command is used to gain real-time information about processes running on the system, with the most processor-intensive processes listed at the beginning of the list? ps ps -elf top pstree
top
Which command is used to delete a user account usermod -d username del username userdel username rm username
userdel username
Which command can you use to lock a user account? lock username secure username usermod -L username useradd -L username
usermod -L username
The Debian Package Manager (DPM) is the default package manager used by Fedora 28) True or False?
False
Which command entered without arguments is used to display a list of processes running in the current shell? pgrep list pid ps
ps
What command is used to view and modify user jobs scheduled to run with cron? crontab cron ps sched
crontab
Which of the following will display the message welcome home if the cd /home/user1 command is successfully executed? A. cd /home/user1 && echo "welcome home" B. cat "welcome home" || cd /home/user1 C. cd /home/user1 || cat "welcome home" D. echo "welcome home" && cd /home/user1
A. cd /home/user1 && echo "welcome home"
When referring to the /etc/rsyslog.conf file, __________ specifies information from a certain area of the system, whereas ________ is the level of importance of that information. A. section, priority B. service, precedents C. process, degree D. facility, priority
D. Facility, priority
What are two means available to resolve a host name to the appropriate IP address? (Choose two answers.) DNS /etc/hosts DHCP /etc/resolve.conf
DNS /etc/hosts
You use lpstat and determine that a user named User1 has placed two large print jobs in the queue for Printer1 that have yet to start printing. They have print job IDs of Printer1-17 and Printer1-21, respectively. Which command would you use to remove these two jobs from the print queue? cancel Printer1-17 Printer1-21 cancel -u Printer1-17 Printer1-21 cancel -a Printer1-17 Printer1-21 cancel 17 21
cancel Printer1-17 Printer1-21
Which of the following commands extracts an archive? cpio -vocBL /dev/fd0 cpio -vicdu -l /dev/fd0 cpio -vicdu -O /dev/fd0 cpio -vti -l /dev/fd0
cpio -vicdu -l /dev/fd0
Which of the following commands creates an archive? tar -cvf /dev/sst0 tar -xvf /dev/st0 tar -tvf /dev/st0 tar -zcvf /dev/st0
tar -zcvf /dev/st0
Which of the following lines can be used to perform command substitution within a shell script? (Choose all that apply.) 'command' ${command} ${!command} $(command)
'command' $(command)
Nice values are used to affect process priorities using a range between _____________. 0 and 20 0 and -19 -19 and 20 -20 and 19
-20 and 19
Which file contains default information such as UID and GID ranges and minimum password length to be used at user creation? /etc/skel /etc/passwd /etc/login.defs /etc/default/useradd
/etc/login.defs
Which file holds the methods to be used and the order in which they will be applied for host name resolution? /etc/hosts/ /etc/nsswitch.conf /etc/resolve.conf /etc/dns.conf
/etc/nsswitch.conf
Which file would you modify to permanently change the IP address of a network interface on a Fedora 28 system? /etc/sysconfig/network-scripts/ifcfg-enp8s0 /etc/sysconfig/network /etc/netplan/50-cloud-init.yaml /etc/network/interfaces
/etc/sysconfig/network-scripts/ifcfg-enp8s0
Most log files on the system are found in which directory? /etc/logfiles /etc/log /var/log /dev/log
/var/log
Which of the following statements is true? (Choose all that apply.) A. If /etc/at.allow exists, only users listed in it can use the at command. B. If /etc/cron.allow exists, only users listed in it can use the cron command. C. If /etc/cron.deny exists and /etc/cron.allow does not exist, any user not listed in /etc/cron.deny can use the cron command. D. If /etc/cron.allow and /etc/cron.deny exist, only users listed in the former can use the cron command and any listed in the latter are denied access to the cron command. E. If a user is listed in both /etc/cron.allow and /etc/cron.deny, then /etc/cron.deny takes precedence and the user cannot access the crontab command.
A. If /etc/at.allow exists, only users listed in it can use the at command. B. If /etc/cron.allow exists, only users listed in it can use the cron command. C. If /etc/cron.deny exists and /etc/cron.allow does not exist, any user not listed in /etc/cron.deny can use the cron command.
You attempt to perform the git commit -m "Added listdir function" but the command fails. What are possible reasons for the failure? (Choose all that apply.) A. The user performing the commit has not set their Git user information. B. No files were added to the Git index beforehand. C. The user performing the commit is not running the command from within the Git repo directory. D. The master branch was not specified within the command itself.
A. The user performing the commit has not set their Git user information. B. No files were added to the Git index beforehand. C. The user performing the commit is not running the command from within the Git repo directory.
When a printer is rejecting requests,____________. A. the print queue does not accept jobs and sends a message to the user noting that the printer is unavailable B. the print queue does accept jobs into the print queue and holds them there until the printer is accepting requests again C. the printer appears as offline when an lp request is sent D. the print queue redirects all print jobs sent to it to /dev/null
A. the print queue does not accept jobs and sends a message to the user noting that the printer is unavailable
Before a computer can use a router, what configuration information must it be provided? default gateway routing table subnet mask default router
default gateway
What would be the effect of using the alias command to make an alias for the date command named cat in honor of your favorite pet? A. It cannot be done as there already is an environment variable cat associated with the cat command. B. It cannot be done because there already is a command cat on the system. C. When you use the cat command at the command prompt with the intention of viewing a text file, the date appears instead. D. There is no effect until the alias is imported because it is a user-declared variable.
C. When you use the cat command at the command prompt with the intention of viewing a text file, the date appears instead.
You have redirected stderr to a file called Errors. You view the contents of this file afterward and notice that there are six error messages. After repeating the procedure, you notice that there are only two error messages in this file. Why? A. After you open the file and view the contents, the contents are lost. B. The system generated different stdout. C. You did not append the stderr to the Error file, and, as a result, it was overwritten when the command was run a second time. D. You must specify a new file each time you redirect as the system creates the specified file by default.
C. You did not append the stderr to the Error file, and, as a result, it was overwritten when the command was run a second time.
How can you bypass the wait function and send a user process to the background? A. This cannot happen once a process is executing; it can be done only when the command is started by placing an ampersand (&) after it. B. This cannot happen; only daemon processes can run in the background. C. You can use the ps command. D. You can use the Ctrl+z key combination and the bg command.
D. You can use the Ctrl+z key combination and the bg command.
The pkill command terminates _________. A. all instances of a process with the same PPID B. all instances of a process with the same PID C. all instances of a process with the same priority D. all instances of a process with the same name matched by a regular expression
D. all instances of a process with the same name matched by a regular expression
Along with a listing of user accounts, the /etc/passwd file contains information on account expiry. True or False?
False
Standalone daemons are started on demand using xinetd. True or False?
False
The NetworkManager or Systemd-networkd components must be installed on a Linux system in order to configure an IP address on a network interface. True or False?
False
To install a new program from RPM software repositories on the Internet, you can use the dnf update programname command) True or False?
False
What does &> accomplish when entered on the command line after a command? It redirects both stderr and stdout to the same location It does not accomplish anything It redirects stderr and stdin to the same location It appends stdout to a file.
It redirects both stderr and stdout to the same location.
Which Windows program is often used to connect to a Linux server via SSH? Putty Rdesktop mstsc
Putty
A for construct is a loop construct that processes a specified list of objects. As a result, it is executed as long as there are remaining objects to process. True or False?
True
Both aliases and functions can be used to store commands that can be executed, but functions can also accept positional parameters. True or False?
True
Most source code is typically available on the Internet in tarball format or as a git repository. True or False?
True
SSH encrypts all traffic that passes across the network, whereas telnet does not. True or False?
True
What is the name given to a process not associated with a terminal? child process parent process user process daemon process
daemon process
Which option to the rpm command can be used to remove a package from the system? r e u U
e
The current value for the HOME variable is displayed by which of the following commands? (Choose all that apply.) echo HOME= echo ~ echo $HOME echo ls HOME
echo ~ echo $HOME
Before a user-defined variable can be used by processes that run in subshells, that variable must be __________. imported validated by running the env command exported redirected to the BASH shell
exported
A process spawning or initiating another process is referred to as _____. A child process forking branching parenting
forking
Which process has a PID of 1 and a PPID of 0? the kernel itself ps init/systemd top
init/systmd
A runaway process that is faulty and consuming mass amounts of system resources ________. is a zombie process is an orphaned process has a PPID of Z is a rogue process
is a rogue process
Which command can be used to see processes running in the background? bg jobs ps -% fg
jobs
What command can you use to view journald log entries on a system that uses Systemd? less journalctl syslog catlog
journalctl
Which of the following commands should be run following the installation of a shared library to update the /etc/ld)so)conf and /etc/ld)so)cache files? ldd updatedb ldconfig dpk-reconfigure
ldconfig
What is the name of the utility used to rotate log files? syslog jetpack logrotate logbackup
logrotate
When compiling source code into a binary program, which command does the compiling using the GNU C Compiler? tar ./configure make make install
make
Which commands can be used to display TCP/IP connections on your Linux system? (Choose all that apply.) netstat-t mtr traceroute show ss -t
netstat -t
To test DNS configuration by resolving a host name to an IP address, which command or commands can you use? (Choose all that apply.) nslookup hostname dighostname hosthostname resolve hostname
nslookup hostname dig hostname host hostname
Every process has a process ID and a_______. fork process daemon child process parent process ID
parent process ID
Which command would you use to unlock a user account? unlock username open username passwd -u username useradd -U username
passwd -u username
The process of sending print jobs from the print queue to the printer is called _____. spooling queuing redirecting printing
printing
You want to generate SSH keys for your user account and copy them to a remote computer to simplify future SSH authentication. What two commands can you use to perform these actions? (Choose two answers.) ssh-keygen ssh-copy-id ssh-add ssh-agent
ssh-keygen ssh-copy-id
When compiling source code into a binary program, which command performs a system check and creates the Makefile? tar ~configure make make install
~configure