linkedin-skill-assessments-quizzes

Linux

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 \* \* \*

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?

Reference

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.

Q53. To elevate privileges using the sudo command, a user must _.

Reference

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?

Reference

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?

Reference

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

Q72. To run CGI scripts with Apache, you need to _.

Reference

Q73. To permanently add NAT to the default zone using firewalld, you would use which command string?

Reference

Q74. What is the difference between using = and == in a BASH double square bracket if conditional?

if [[ $FILE == $GLOB ]] ;then

Reference

Q75. journald differs from traditional logging services such as rsyslogd and syslogd because its logs are _ by default.

Reference

Q76. What is the purpose of a Mail Transport Agent (MTA)?

Q77. What do you need to do before you can perform SSH passwordless logins?

Reference

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)?

Reference

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]))$

Q83. Typing systemctl enable crond does what to the crond service?

Q84. Which of these features is missing from the Bash Language?

Q85. What is the first step to integrate extended globs into your command-line workflow?

Q86. Which statement about default ACLs is true?

Reference

Q87. The object that systemd uses to manage services is called a _ file.

Reference

Q89. What is the difference between the apt remove and apt autoremove commands?

Reference

Q90. You want to extract the contents from an rpm package. Which command do you use?

  1. Reference
  2. Reference

Q91. Which variable contains last background job process id?

Reference

Q92. Which feature does LVM2 included in most distributions not support?

Q93. Which improvements do access control lists (ACLs) have over standard Linux permissions?

Q94. What is a maximum length for a filename under Linux?

Q95. Which command do you use to rename a file in Linux?

Q96. Which file is backup file of /etc/passwd ?

Q97. Which Vim command writes your changes to the currently open file and quits the Vim editor?

Q98. Just like IP addresses identify hosts on a network, _ identify the services on a host.

Q99. Which command shows the free disk space on one or more Linux filesystems?

Q100. In Linux, the Epoch is the number of seconds that have elapsed since January 1st, _.

Q101. In which Linux shell script positional parameter is the script itself stored?

Q102. VirtualBox provides _, which are installed on guests and allow the guest operating system to access shared folders on the host system, share the clipboard, and some other similar actions.

Q103. Given an IP address of 199.83.131.0 and a subnet mask of 255.255.255.0, what is the broadcast address?

Q104. Which Linux command shows a list of processes associated with the current user and the current terminal?

Q105. In a shell script, to create an infinite while loop, make the condition always return true by using the _ command for the while loop condition.

Q106. In Linux, which option is used with the uname command to print the processor architecture name?

Q107. Which of these do NOT constitute as a default part of the email system of Red Hat Linux?

Q108. In BASH parsing, which expansion happens first?

Reference

Q109. When pattern matching using a glob or regular expression, how many characters does a character set match?

Reference

Q110. Why would you not use the mdadm --assemble subcommand when creating a new RAID5 array?

Q111. Which of the following types is not a default type of input/output in Linux?

Reference

Q112. In a shell script, _ means OR.

Reference

Q113. On a Linux or Unix system using X Window, the GVim * register _.

Reference

Q114. What system mode does Linux runlevel 0 indicate?

Reference

Q115. Which of the following choices is not a mode in Vi?

Reference

Q116. which command used for delete a user?

Q117. What is the kernel of a Linux operating system?

reference