Q1. To mount a drive by its ID, what command would you use first to retrieve it?
Q2. Linux file access control lists (ACLs) are _.
Q3. When using iproute2, how do you show routing information for an IPv6 network?
Q4. What does this command string do?
find / -size +10M -exec ls -l {} ;
Q5. What would this locate command show?
locate --regexp '^/usr.*pixmaps.*jpg$'
Q6. Which command allows you to do packet analysis from the command line?
Q7. Which command will tell you how long a system has been running?
Q8. How would you describe PCP (Performance Co-Pilot)?
Q9. You want to resolve a long list of DNS names using dig. What should you do?
Q10. What would this command output?
ps -e --format uid,pid,ppid,%cpu,cmd
Q11. Which command in Bash executes the last line in the shell history that starts with ls?
Q12. The ssh-copy-id command copies _ to the remote host.
Q13. What command is used to determine the amount of disk usage for a directory?
Q14. A backup drive was created using dd to make a bit-for-bit copy. When the drive is inserted into an iSCSI target before it is booted up, the data appears to be missing. What could have happened?
Q15. What is the key difference between a redirect (>) and piping to the tee command?
Q16. What does the /etc/nsswitch.conf file manage?
Q17. Assume the variable myNumber holds a string consisting of 10 digits. What will this command output?
echo $myNumber | sed -e 's/^[[:digit:]][[:digit:]][[:digit:]]/(&)/g'
Note: check the question below for a variant of this sed expression.
Q18. What would this sed command do?
sed -E 's/[a-Z]{4}/(&)/' textfile.txt
Note: check the question above for a variant of this sed expression.
Side note: this sed expression may fail with "sed: -e expression #1, char 15: Invalid range end" (for example on MINGW64 / Git Bash); if this is the case, you can try the alternative range [A-z].
Q19. Packages can be downloaded but not installed with yum or dnf by specifying which option?
Q20. What character class is equal to this set?
[0-9]
Q21. When archiving files, which command will preserve all file attributes including ACLs and SELinux security context?
Q22. In a systemd-based OS, you can change the system hostname by editing /etc/hostname manually and then doing what?
Q23. What command would you use to resize an LVM volume group to include an additional physical volume?
Q24. When would this system cron job run its task?
0 1 * * *
Q25. ifconfig has been deprecated. What command is now recommended for changing IP addresses in the live config?
Q26. You are managing an Apache web server on a system using SELinux. By default it cannot read personal webpages in users' home directories. What SELinux boolean would you set to allow this?
Q27. Why doesn't passwd -l keep a user from logging in via other methods?
Q28. In the Bash shell, what is the difference between piping into | and piping into |&?
Q29. Why is the passwd command able to modify the /etc/passwd file?
Q30. When a user deletes a file using the rm command, Linux will _.
Q31. What is a major advantage of using Logical Volume Management (LVM)?
Q32. What is one major difference between brace expansion and globs?
Q33. To remove all ACLs from a directory, use setfacl with which options?
Q34. Which choice will not print "Hello World" in the terminal?
myVar = 5
[[ $myVar -lt 10 ]] && echo " Hello World"
myVar = 5
[[ $myVar -lt 10 ]] || echo " Hello World"
myVar = 5
[[ ! $myVar -gt 10 ]] && echo " Hello World"
myVar = 5
[[ $myVar -gt 10 ]] || echo " Hello World"
Q35. What is not inherited by child process?
Q36. What NFS option allows the root user to access NFS shares as the root user?
Q37. You send an email to a remote client using the following syntax. What will be in the body of the email?
date | mail -s "This is a remote test" user1@rhhost1.localnet.com
Q38. What is the /etc/hosts file used for?
Q39. In an extended regular expression, you would use (pattern){3} to match three instances of the pattern. How would you match the same thing with an extended glob?
Q40. When configuring a Samba share, how would the engineering group be specified in the smb.conf?
Q41. To configure the Kerberos client, which command should you use to import the keytab file?
Q42. To search from the current cursor position up to the beginning of the file using VIM, type _ and then the search criteria.
Q43. What is the job of the NetworkManager daemon?
Q44. Why might would you use the usermod command?
Q45. Extending an LVM volume group does what to the formatted filesystem?
Q46. Which kernel module do you need to load to use interface bonding?
Q47. What does this command string do?
find / -size -10K -exec ls -l {} \;
Q48. To change the priority of multiple swap partitions, which file would you edit?
Q49. What would you type to list all systemd service unit files, whether they are enabled or not?
Q50. You can set Linux group passwords using which command?
Q51. With most GNU commands, if an option is a word, what will it be preceded by?
Q52. What would happen if you have a script file named script that takes a long time to complete, and you type nohup ./script & in the command line?
nohup is a POSIX command which means "no hang up". Its purpose is to execute a command such that it ignores the HUP (hangup) signal and therefore does not stop when the user logs out.
Q54. When would this system cron job run its task?
0 22 * * 1-5
Q55. How does TCP Wrappers differ from a firewall?
Note: TCP Wrapper works on Application Layer but answer is not too much confirmed.
Q56. As root, you set execute permissions for user, group, and other on a directory. Now users can do what?
Note: This is correct because of the keyword "directory". More info here.
Q57. What will this command print?
echo "Thu Jun 4 15:45:45 PDT 2020" | cut -f3 -d" "
Q58. How can you improve this code snippet?
if ls /etc/passwd &> /dev/null
then
echo "exists"
fi
Q59. Using a systemd-based distribution, you want to restrict the cron service from running either automatically or manually. Which command would you run?
Note: This is the correct answer because "mask" prohibits all kinds of activation of the unit, including manual activation.\ Reference: search "mask".
Q60. What issue might a user have when they mount a filesystem by partition path such as /dev/sdal in the /etc/fstab file?
Q61. Which option would you choose to force grep to use a basic regular expression (BRE)?
Explanation: Man page of grep command.
Q62. An rsyslogd filter determines which items in a log file to act on. What is it made up of?
Q63. Which choice is a Network Manager tool used to configure network connections from the GUI?
Q64. What will not happen if you run the make command without parameters?
Q65. Most commands that support SELinux use which option to display SELinux security context?
Q66. What is the difference between the whoami and logname commands?
Q67. What is the command to create an associative array in Bash?
Q68. What tool should you use to replace a physical volum in LVM?
Q69. What is the difference the == and =~ comparison operators when used in BASH double square bracket if conditionals?
Q70. What is the difference between these two lines of code?
echo "data" | tee -a file.txt
echo "data" >> file.txt
Q71. Using backreferences in a POSIX regular expression, which word would this pattern match?
(ss).*\1
Q73. To permanently add NAT to the default zone using firewalld, you would use which command string?
Q74. What is the difference between using = and == in a BASH double square bracket if conditional?
if [[ $FILE == $GLOB ]] ;then
Q75. journald differs from traditional logging services such as rsyslogd and syslogd because its logs are _ by default.
Q76. What is the purpose of a Mail Transport Agent (MTA)?
Q78. When installing a downloaded package on the RedHat-based distribution manual using RPM, what may you have to do first?
Explanation: Rpm is not meant to resolve dependencies. It checks whether required software (versions) are installed and fails when software is missing and when the wrong version of software is installed.
Q79. With GNU tools such as a GNU grep, awk, and sed, what is the difference between basic regular expressions (BREs) and extended regular expressions (EREs)?
Q80. What is the difference between reading the list of disk partitions from /proc/partitions and getting it using fdisk -l?
Q81. What would be in out.txt?
cat < in.txt > out.txt
Q82. Using alternation in a POSIX-extended regular expression, which numbers would this pattern match?
^(([0-9][0-9]?)|(2[0-9][0-9]))$