Linux Quiz Questions: Quizzes 6 - 10
Which of the following kill level signals could let a process reload its configuration? a) 1 b) 2 c) 3 d) 4
1
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? (Hint: cron adopts the same approach as at) a) /etc/cron.deny b) /etc/cron.d/cron.deny c) /etc/cron.allow d) /etc/cron.d/cron.allow
a
After a background process has been started, what command below can be used to move it to the foreground? a) fg b) fgnd c) fgd d) b2f
a
After compiling source code, which command still needs to be run in order to copy the newly compiled binaries into a directory listed in the PATH variable as well as copy supporting files (such as man pages) to the correct location on the filesystem? a) make install b) make c) make image d) make clean
a
Before a user-defined variable can be used by a process that runs in subshells, that variable must be __________. a) exported b) validated by running the env command c) redirected to the BASH shell d) imported
a
If a user enters the rescue.target, who is she/he automatically logged in as? a) root b) user1 c) rescue d) admin
a
In the /etc/shadow file, what does an exclamation mark (!) in the password field indicate? a) The account is locked b) The account is disabled c) The password has expired d) No password is set
a
In what directory are the Linux kernel and grub configuration files stored? a) /boot b) /init c) /sbin d) /kernel
a
Which dump level indicates a full backup? a) 0 b) 1 c) 9 d) 10
a
Which of the following can be used at the command line to download a file from a http link? a) wget b) get c) linkget d) hget
a
Which of the following commands can be used to set primary group membership for user account jsmith a user? a) usermod -g b) usermod -G c) usermod -ag d) usermod -aG
a
Which of the following commands can be used to terminate a process by the process name? a) kill b) killall c) stop d) pskill
a
Which of the following commands will display a list of Systemd units sorted by the time they took to load? a) systemd-analyze blame b) systemd --listload c) systemctl --listload d) systemctl-analyze --blame
a
Which of the following files contains full and incremental backup information for use with the dump utility? a) /etc/dumpdates b) /etc/dumps c) /etc/dumpdata d) /etc/dumpjournal
a
Which option is used to extract files from a tar archive? a) -x b) -d c) -e d) -ex
a
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? a) ctrl-c b) ctrl-q c) ctrl-w d) ctrl-x
a
Which MBR limitations are overcome by GPT? (Choose all that apply) a) Lack of resilience to data corruption b) Slow boot times c) Limited number of primary partitions d) Lack of disk encryption
a, c
Which of the following can uncompress a gzipped file? (Choose all that apply) a) gzip -d the-gzipped-file b) unzip the-gzipped-file c) gzip -u the-gzipped-file d) gunzip the-gzipped-file
a, d
Which of the following files will be executed after a user receives a BASH shell without login? Assume that all of these files exist and we adopt the current settings of Fedora distributions. (Choose all that apply.) a) ~/.bashrc b) ~/.bash_profile c) /etc/profile d) /etc/bashrc
a, d
After modifying the /etc/default/grub file, what must you do for your changes to be reflected by GRUB on the next boot? a) run the grub2-install command b) run the grub2-mkconfig command c) copy the file to the /boot/grub directory d) run the dracut command
b
How can you redirect the standard error (stderr) of a command to a file while discarding its standard output (stdout)? a) 2>/dev/null 1>error.log b) 1>/dev/null 2>error.log c) 1>/dev/null >error.log d) 1>/dev/null 0>error.log
b
In LVM, PEs (physical extents) are created when PVs (Physical Volumes) are created. a) True b) False
b
In the shadow file, a user's last day of changing password is zero. That means the user has never changed his/her password. a) True b) False
b
In which of the following directories can you place files that will be copied to new user directories when new users are created? a) /etc/rc.d b) /etc/skel c) /usr/local/template d) /usr/local/useradd
b
To schedule a cron job to run on weekdays only, which day-of-week field value should be used? a) 0-4 b) 1-5 c) */5 d) 1/5
b
What UEFI option allows for a boot loader to be verified using a digital signature? a) Netboot b) Secure boot c) PXE d) initialization validation
b
What command can you use to check the status of a systemd service? a) service status b) systemctl status c) status service d) systemctl info
b
What does << accomplish when used as cat >file1 <<bye a) It redirects Standard Output to file1 b) It indicates the end of inputs is bye c) It does not accomplish anything d) It redirects inputs to Standard Input
b
What signal does the kill command send by default? a) SIGSTOP b) SIGTERM c) SIGKILL d) SIGINT
b
Which Git command is used to combine the changes from one branch into another? a) get push b) git merge c) get pull d) git diff
b
Which LVM component is responsible for combining one or more Physical Volumes (PVs) into a single storage pool? a) File System (FS) b) Volume Group (VG) c) Physical Extent (PE) d) Logical Volume (LV)
b
Which of the following can be used preceding a command to prevent a process from terminating when the parent process (e.g., bash) terminates? a) runat b) nohup c) bg d) &
b
Which of the following commands can be used to configure the Postfix daemon to start in the default runlevel on a Linux system that uses Systemd? a) chkconfig postfix on b) systemctl enable postfix.service c) service postfix start d) systemctl start postfix.service
b
Which of the following commands can lock a user account? a) lock username b) usermod -L username c) nologin username d) passwd -! username
b
Which of the following commands can you use to view events within the journald database? a) journald --list b) journalctl c) journal --display d) viewlogs --journald
b
Which of the following commands will show the current user cron jobs that have been created for the currently logged in user? a) cron -l b) crontab -l c) cronjobs --list d) cron --list
b
Which of the following does Systemd use to denote runlevels? a) service units b) target units c) mount units d) timer units
b
Which of the following is the first field of the /etc/passwd file? a) UID b) username c) GECOS d) password
b
Which of the following is the first process generated on Linux systems using Systemd? a) init b) systemd c) sysload d) sysinit
b
Which of the following will invalid entries in the GRUB2 configuration cause? a) kernel warning automatically skipping invalid entries b) kernel panic and halt the system c) kernel error with confirmation to skip invalid entries d) no error, automatically skipping invalid entries until a valid entry is found
b
While the top command is running, what key can be pressed to change the nice value of a process? a) n b) r c) p d) v
b
Which of the following are the advantages of systemd over systemV? (Choose all that apply) a) Support for UEFI b) Consolidated commands c) Faster booting process due to parallelism d) Support for Grub2
b, c
Which of the following commands will display a list of the pending jobs to be run? (Choose all that apply.) a) at -d b) at -l c) atq d) at -s
b, c
Which command can be used to display messages from the MySQL daemon between 10:00 am and 10:15 am today? (Choose all that apply.) a) journalctl --range "10:00-10:15" mysqld.service b) journalctl _COMM=mysqld --since "10:00" --until "10:15" c) journalctl --unit mysqld.service --range "10:00-10:15" d) journalctl --unit mysqld.service --since "10:00" --until "10:15"
b, d
A system administrator wants to schedule a task to run at midnight but knows that they will not be in the office at that time. Which of the following commands can they use to schedule this task to run that night while they are at home? a) exec -t 00:00 b) run -t 00:00 c) at midnight d) crontab -e 00:00
c
What is the purpose of the "git log" command? a) To display the working directory's status b) To switch to a different branch c) To view a history of commits d) To create a new branch
c
What option can be used with the ps command to display an entire list of processes across all Terminals, including daemons? a) -a b) -f c) -e d) -l
c
Which command could you use to view a list of user-defined shell variables as well as their current values? a) env b) export c) set d) echo
c
Which of the following commands can a user run to display the groups that the user is a member of? a) groupmod --list b) groups --list c) id d) groupls
c
Which of the following commands can be used to configure daemon services (e.g., on or off) for a specific targets? a) sysconfig b) chkconfig c) systemctl d) sysctl
c
Which of the following commands can be used to delete a user account? a) deleteuser b) rmuser c) userdel d) userrm
c
Which of the following commands will display the exit status of the last command used in the BASH shell? a) echo $status b) echo $exit c) echo $? d) echo $!
c
Which of the following commands will install a package using the Red Hat Package Manager, showing all information, while printing the # signs to show the progress of installation? a) rpm -iah packagename.rpm b) rpm -iap packagename.rpm c) rpm -ivh packagename.rpm d) rpm -ivp packagename.rpm
c
Which of the following is a special group that provides its members with the ability to run commands as the root user via the sudo command on Fedora Linux systems? a) sudoers b) adm c) wheel d) sys
c
Which of the following options for the tar command will create an archive that is also gzipped while displaying all of the work in progress to the terminal screen? a) tar -ngac b) tar -cfza c) tar -czvf d) tar -nzaf
c
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? a) cat /etc/passwd | grep root | merge ~/root.txt b) cat /etc/passwd | grep root >> ~/root.txt c) grep root /etc/passwd | tee ~/root.txt d) grep root /etc/passwd | split ~/root.txt
c
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? a) usermod --expiry jsmith b) chage -u jsmith c) chage -l jsmith d) lsuser jsmith
c
You believe that a file belongs to an installed RPM package. Which of the following commands can be used to find out what is the name of the package? a) rpm -qi file-name b) rpm -ql file-name c) rpm -qf file-name d) rpm -qc file-name
c
Assume that today is 14305 in UNIX epoch time. Currently, the shadow entry for Jay is as follows: Jay:$6$password_hash:14300:0:60:7:10:: Which of the following entry will disable Jay's account 300 days from today. a) Jay:$6$password_hash:14300:0:60:7:14605:: b) Jay:$6$password_hash:14300:0:60:7:10:300: c) Jay:$6$password_hash:14605:0:60:7:10:: d) Jay:$6$password_hash:14300:0:60:7:10:14605:
d
Files that have been compressed using the gzip utility typically have the ______ extension. a) .tgz b) .zip c) .bz2 d) .gz
d
In a cron expression, what does the asterisk (*) represent in the "minutes" field? a) Specific minute of the hour b) Every even minute c) No specific value d) Every minute
d
To assign a specific user ID (UID) when creating a new user with useradd, which option should be used? a) -i b) -n c) -id d) -u
d
Using the syntax below, what command will create directories named one, two, and three? echo one two three | ___________ mkdir a) sort b) pipe c) tee d) xargs
d
What command can be used to display the contents of a file that was compressed with the gzip utility? a) ccat b) acat c) bcat d) zcat
d
What command looks for a Makefile and uses the information within it to compile the source code into binary programs using the appropriate compiler program for the local hardware architecture? a) configure b) install c) make install d) make
d
What is the primary purpose of Logical Volume Management (LVM) in Linux? a) To manage user permissions b) To create and manage physical partitions c) To create flexible filesystem d) To dynamically allocate and manage storage space
d
When compiling source code into a binary program, which command performs system checks and creates the Makefile? a) check-configure b) make c) chkconfig d) configure
d
Which command can be used to restart the DHCP daemon on a Linux server that uses Systemd? a) service restart dhcpd b) /etc/rc.d/init.d/restart --service dhcpd c) /etc/rc.d/dhcpd restart d) systemctl restart dhcpd.service
d
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? a) $ b) > c) % d) #
d
Which of the following command can change a user's password aging conditions according to the following requirements:The user is allowed to use the same password for 100 days (maximum).The user cannot make more than one password changes within one single day.The system should display warning messages 15 days before the user's password expiry. The grace period before disabling the account after password expiry is one week. a) chage -M 1 -m 100 -W 15 -E 7 username b) chage -m 1 -W 100 -W 15 -F 7 username c) chage -M 1 -m 100 -W 15 -I 7 username d) chage -m 1 -M 100 -W 15 -I 7 username
d
Which of the following commands can be used to show the full information (e.g., its developer and version) about a package? a) rpm -qc package-name b) rpm -ql package-name c) rpm -qa package-name d) rpm -qi package-name
d
Which of the following commands will display the contents of the /etc/passwd file in alphanumerical order? a) cat --sort /etc/passwd b) cat -s /etc/passwd c) sed /etc/passwd c) sort /etc/passwd
d
Which of the following commands will send a process's resources to /dev/null to kill the process for process ID 1357 (i.e., the signal cannot be trapped by the process)? a) sigkill 1357 b) killall 1357 c) kill -15 1357 d) kill -9 1357
d
Which of the following commands will set the default target of a Linux system? a) systemctl set-init b) systemctl --default c) systemctl --set-default d) systemctl set-default
d
Which of the following is a tool that can be used to search Internet software repositories for RPM packages that map to your system's architecture, and automatically install or upgrade those packages on your system? a) tar b) wget c) apt d) dnf
d