When redirecting the output of find to the xargs command, what option to find is useful if the filenames contain spaces?
–rep-space
-printnul
-nospace
–ignore-space
–print0
 This option to the find command is useful if the filenames contain spaces when redirecting the output of find to the xargs command. The syntax of the option is:
find [where to start searching from] [expression determines what to find] -print0
The -print0 option tells the find command to print the full file name on the standard output, followed by a null character (ASCII code 0) instead of the newline character. This allows file names that contain spaces or other special characters to be correctly interpreted by the xargs command, which can use the -0 option to read items from the standard input that are terminated by a null character. The syntax of the xargs command with the -0 option is:
xargs -0 [command]
The -0 option tells the xargs command to expect the items from the standard input to be separated by a null character, and to execute the command using the items as arguments.
Therefore, the command find … -print0 | xargs -0 … will search for files and directories using the find command, print the results with a null character as the separator, pipe the output to the xargs command, which will read the items with a null character as the separator, and execute another command using the items as arguments. This will avoid any problems with filenames that contain spaces or other special characters.
The other options are incorrect for the following reasons:
References:
Which command uninstalls a package but keeps its configuration files in case the package is re-installed?
dpkg –s pkgname
dpkg –L pkgname
dpkg –P pkgname
dpkg –v pkgname
dpkg –r pkgname
The command that uninstalls a package but keeps its configuration files in case the package is re-installed is dpkg -r pkgname. The dpkg command is the low-level tool for installing, building, removing, and managing Debian packages. The -r or --remove option removes an installed package from the system, but it does not delete the configuration files and other data that belong to the package. This way, if the package is re-installed later, the previous settings are preserved. The dpkg command is part of the 101.1 Determine and configure hardware settings topic of the LPI Linux Essentials certification program12.
The other options are either invalid or do not perform the desired task. The dpkg -s pkgname command shows the status of an installed package, but it does not uninstall it. The dpkg -L pkgname command lists the files that belong to an installed package, but it does not uninstall it. The dpkg -P pkgname command purges an installed or removed package, which means it deletes the configuration files and other data that belong to the package. The dpkg -v pkgname command shows the version of an installed package, but it does not uninstall it.
What does the? symbol within regular expressions represent?
Match the preceding qualifier one or more times.
Match the preceding qualifier zero or more times.
Match the preceding qualifier zero or one times.
Match a literal? character.
The ? symbol within regular expressions represents an optional match of the preceding qualifier. A qualifier is a character or a group of characters that can be repeated a certain number of times, such as , +, ?, {n}, {n,}, or {n,m}. The ? symbol means that the qualifier can occur zero or one times, but not more. For example, the regular expression colou?r matches both “color†and “colourâ€, but not “colouur†or “colrâ€. The ? symbol can also be used to make other qualifiers lazy, meaning that they will match the smallest possible number of characters, instead of the largest (greedy). For example, the regular expression a.?b matches the shortest string that starts with “a†and ends with “bâ€, such as “ab†or “a-bâ€, but not “a-b-câ€. References:
Which of the following commands redirects the output of ls to standard error?
ls >-1
ls <
ls >&2
ls >>2
ls |error
This command redirects the output of ls to standard error, which is file descriptor 2 by default. The syntax of the command is:
ls >& file_descriptor
The ls command is a utility that lists the files and directories in the current working directory or a specified directory. The >& symbol is a redirection operator that redirects the standard output of a command to another file descriptor, which can be a file, a device, or another stream. The file_descriptor is the number of the file descriptor to which the output is redirected.
Therefore, the command ls >&2 will run the ls command and redirect its output to file descriptor 2, which is standard error. This means that the output of ls will not be displayed on the screen, but sent to the standard error stream, which can be used for error handling or logging purposes.
The other commands are incorrect for the following reasons:
A user accidentally created the subdirectory \dir in his home directory. Which of the following commands will remove that directory?
rmdir '~/\dir'
rmdir "~/\dir"
rmdir ~/'dir'
rmdir ~/\dir
rmdir ~/\\dir
The rmdir command removes an empty directory. To remove a directory whose name contains a backslash, the backslash must be escaped with another backslash. Therefore, the correct command is rmdir ~/\dir. The other commands will either fail to find the directory or interpret the backslash as part of a path name. References:
Which of the following commands replaces each occurrence of 'bob' in the file letter with 'Bob' and writes the result to the file newletter?
sed '/bob/Bob' letter > newletter
sed s/bob/Bob/ letter < newletter
sed's/bob/Bob' letter > newletter
sed 's/bob/Bob/g' letter > newletter
sed 's/bob, Bob/' letter > newletter
 The command that replaces each occurrence of ‘bob’ in the file letter with ‘Bob’ and writes the result to the file newletter is sed ‘s/bob/Bob/g’ letter > newletter. This command uses the following options and syntax:
The output of this command will be a new file called newletter that contains the same text as letter, except that every ‘bob’ is replaced by ‘Bob’. For example, if the file letter contains the following text:
Dear bob, I hope this letter finds you well. I am writing to inform you that your subscription to our magazine has expired. If you wish to renew it, please send us a check for $50 by the end of this month. Otherwise, we will have to cancel your subscription and remove you from our mailing list. Thank you for your cooperation and support. Sincerely, Alice
The file newletter will contain the following text:
Dear Bob, I hope this letter finds you well. I am writing to inform you that your subscription to our magazine has expired. If you wish to renew it, please send us a check for $50 by the end of this month. Otherwise, we will have to cancel your subscription and remove you from our mailing list. Thank you for your cooperation and support. Sincerely, Alice
The other commands are incorrect for the following reasons:
References:
Which of the following commands will reduce all consecutive spaces down to a single space?
tr '\s' ' ' < a.txt > b.txt
tr -c ' ' < a.txt > b.txt
tr -d ' ' < a.txt > b.txt
tr -r ' ' '\n' < a.txt > b.txt
tr -s ' ' < a.txt > b.txt
The command that will reduce all consecutive spaces down to a single space is tr -s ’ ’ < a.txt > b.txt. This command uses the following options and syntax:
The output of this command will be a new file called b.txt that contains the same text as a.txt, except that any sequence of multiple spaces will be replaced by a single space. For example, if the file a.txt contains the following text:
This is a text file with multiple spaces.
The file b.txt will contain the following text:
This is a text file with multiple spaces.
The other commands are incorrect for the following reasons:
References:
Which command will disable swapping on a device? (Specify ONLY the command without any path or parameters.)
The swapoff command is used to disable swapping on a device or a file. It takes the path of the device or file as an argument, or -a to disable all swaps. Disabling swap can improve the performance of the system if there is enough physical memory, or it can be necessary if the swap size needs to be changed. However, disabling swap can also cause problems if the system runs out of memory and has no swap space to use. References:
What command will generate a list of user names from /etc/passwd along with their login shell?
column -s : 1,7 /etc/passwd
chop -c 1,7 /etc/passwd
colrm 1,7 /etc/passwd
cut -d: -f1,7 /etc/passwd
The cut command is used to extract sections from each line of a file or input stream. The -d option specifies the delimiter that separates the fields in each line. The -f option specifies the fields to select. In this case, the delimiter is a colon (:) and the fields are 1 and 7. The first field is the user name and the seventh field is the login shell. Therefore, the cut command with these options will generate a list of user names and their login shells from /etc/passwd. References:
Which of the following signals is sent to a process when the key combination CTRL+C is pressed on the keyboard?
SIGTERM
SIGINT
SIGSTOP
SIGKILL
The SIGINT signal is sent to a process when the user presses the key combination CTRL+C on the keyboard. This signal is used to interrupt the process and cause it to terminate, unless the process catches or ignores the signal. The SIGTERM signal is the default signal sent by the kill command to request a process to terminate gracefully. The SIGSTOP signal is used to pause a process and make it stop executing until it receives a SIGCONT signal. The SIGKILL signal is used to force a process to terminate immediately and cannot be caught or ignored by the process. References:
Which of the following commands can be used to create a USB storage media from a disk image?
gdisk
dd
cc
fdisk
mount
The command dd can be used to create a USB storage media from a disk image. The command dd is a low-level utility that can copy and convert data from one source to another, such as files, devices, or pipes. It can be used to create a bootable USB drive from an ISO image or a raw disk image. The syntax is: dd if=input of=output [options]. For example, to create a USB storage media from a disk image file named linux.img, the command would be:
dd if=linux.img of=/dev/sdb
This will copy the contents of linux.img to the device /dev/sdb, which is assumed to be the USB drive. The device name may vary depending on the system, so it is important to check the correct device name beforerunning the command. The command dd can also accept various options, such as bs to specify the block size, status to show the progress, or conv to apply conversions to the data. For example, to create a USB storage media from an ISO image file named linux.iso, with a block size of 4 MB and a progress indicator, the command would be:
dd if=linux.iso of=/dev/sdb bs=4M status=progress
The command dd is also known as "disk destroyer" because it can overwrite data without warning or confirmation. Therefore, it is advisable to use it with caution and backup any important data before using it. The other options are not correct because:
Which of the following commands prints all files and directories within the /tmp directory or its subdirectories which are also owned by the user root? (Choose TWO correct answers.)
find /tmp -uid root -print
find -path /tmp -uid root
find /tmp -user root -print
find /tmp -user root
find -path /tmp -user root –print
 The find command is used to search for files and directories that match certain criteria. The -uid option specifies the numeric user ID of the owner of the file or directory, while the -user option specifies the name of the owner. The -print option prints the full file name of the matching file or directory to the standard output. Therefore, both find /tmp -uid root -print and find /tmp -user root -print will print all files and directories within the /tmp directory or its subdirectories which are also owned by the user root. The other options are either invalid or do not perform the desired task. The -path option matches the whole path name, not just the starting directory. The -print option is implied if no other action is specified, but it is good practice to include it for clarity. References:
What is the difference between the i and a command of the vi editor?
i (interactive) requires the user to explicitly switch between vi modes whereas a (automatic) switches modes automatically.
i (insert) inserts text before the current cursor position whereas a (append) inserts text after the cursor.
i (independent rows) starts every new line at the first character whereas a (aligned rows) keeps the indentation of the previous line.
i (interrupt) temporarily suspends editing of a file to the background whereas a (abort) terminates editing.
The i and a commands are two of the most commonly used commands in the vi editor to enter the insert mode. The insert mode allows the user to insert text into the file. The difference between the i and a commands is that the i command inserts text before the current cursor position, while the a command inserts text after the cursor position. For example, if the cursor is on the letter “e†in the word “editorâ€, then pressing i will allow the user to insert text before the “eâ€, while pressing a will allow the user to insert text after the “eâ€. The user can exit the insert mode by pressing the Esc key, which will return to the command mode. References:
Which of the following commands determines the type of a file by using a definition database file which contains information about all common file types?
magic
type
file
pmagic
hash
The file command determines the type of a file by using a definition database file which contains information about all common file types. The database file is usually located at /usr/share/misc/magic or /usr/share/file/magic and can be customized by the user. The file command analyzes the content and structure of the file and compares it with the patterns in the database file to identify the file type. The file command can also check the file name extension, but it does not rely on it. The other options are either invalid or do not perform the desired task.The magic, pmagic and hash commands are not valid Linux commands. The type command is used to display information about command type, not file type. References:
Which character, added to the end of a command, runs that command in the background as a child process of the current shell?
!
+
&
%
#
The character that, added to the end of a command, runs that command in the background as a child process of the current shell is the ampersand symbol (&). This means that the command will not block the shell and the user can enter other commands while the background command is running. The background command will also not receive any input from the keyboard or the terminal. The shell will print the job number and the process ID of the background command, and the user can use the jobs command to list the status of all background jobs in the current shell session. To bring a background job to the foreground, the user can use the fg command with the job number or the process ID. To terminate a background job, the user can use the kill command with the process ID.
The other characters are not valid or relevant for running a command in the background. The exclamation mark (!) is used to access the command history or to negate a condition. The plus sign (+) is used for arithmetic operations or to append text. The percent sign (%) is used for arithmetic operations or to refer to a job number. The hash sign (#) is used for comments or to specify a hexadecimal number.
References:
In the vi editor, which of the following commands will copy the current line into the vi buffer?
c
cc
1c
yy
1y
The command that will copy the current line into the vi buffer is yy. The yy command is a shorthand for yank yank, which means to yank (copy) the current line. The vi buffer is a temporary storage area where thecopied text is stored until it is pasted somewhere else. The yy command can also be preceded by a number to indicate how many lines to copy. For example, the command 3yy will copy the current line and the next two lines into the buffer.
The other commands are incorrect for the following reasons:
References:
Which signal is missing from the following command that is commonly used to instruct a daemon to reinitialize itself, including reading configuration files?
killall -s _______ daemon
The signal that is missing from the following command that is commonly used to instruct a daemon to reinitialize itself, including reading configuration files, is SIGHUP. The command should be:
kill -HUP pid
The option -HUP specifies the signal to be sent to the process, which is the hangup signal (SIGHUP). This signal is traditionally used to notify a process that the controlling terminal has been closed, but it is also commonly used to instruct a daemon to reinitialize itself, such as reloading its configuration files or reopening its log files. The argument pid is the process ID of the daemon to be reinitialized. For example, to reinitialize the nginx web server daemon with the PID 1234, the command would be:
kill -HUP 1234
This will cause the nginx daemon to reload its configuration files and gracefully restart its worker processes1. The other signals are not commonly used for this purpose, as they have different meanings and effects. For example, SIGTERM requests the process to terminate gracefully, SIGKILL forces the process to terminate immediately, SIGSTOP suspends the process, and SIGCONT resumes the process2. References:
Which shell command is used to continue background execution of a suspended command?
&
bg
cont
exec
:&
The bg command is used to resume a suspended command in the background, allowing it to run without user interaction. The command takes a job ID as an argument, which can be obtained by using the jobs command. Alternatively, if no job ID is specified, bg will resume the most recently suspended job. The bg command is part of the job control features of the Linux shell, which allow users to manage multiple processes running in the same terminal. References:
What is the default action of the split command on an input file?
It will break the file into new files of 1,024 byte pieces each.
It will break the file into new files of 1,000 line pieces each.
It will break the file into new files of 1,024 kilobyte pieces each.
It will break the file into new files that are no more than 5% of the size of the original file.
The split command in Linux is used to split large files into smaller files. The default action of the split command on an input file is to break the file into new files of 1,000 line pieces each. The names of the new files are PREFIXaa, PREFIXab, PREFIXac, and so on. By default, the PREFIX of the new files is x, but it can be changed with the -a option. For example, the following command will split the file someLogFile.log into new files of 1,000 lines each with the prefix log:
split someLogFile.log -a 3 log
The new files will be named logaaa, logaab, logaac, and so on. To verify the number of lines in each new file, we can use the wc command with the -l option. For example, the following command will show the number of lines in the first and the last new file:
wc -l logaaa logaas
The output will be:
1000 logaaa 170 logaas
This means that the original file had 17,170 lines and was split into 18 new files. 17 of them have 1,000 lines each, and the last one has the remaining 170 lines. References:
Which of the following files, located in a user’s home directory, contains the Bash history?
.bashrc_history
.bash_histfile
.history
.bash_history
.history_bash
The correct answer is D, .bash_history. This file, located in a user’s home directory, contains the Bash history, which is a list of commands that the user has entered in the Bash shell. The syntax of the file is:
~/.bash_history
The ~ symbol represents the user’s home directory, which is usually /home/username. The / symbol is a directory separator that separates the components of a path. The . symbol at the beginning of the file name indicates that the file is hidden, which means that it is not normally displayed by the ls command or the file manager, unless the -a option or the show hidden files option is used. The bash_history is the name of the file that stores the Bash history.
The Bash history is maintained by the Bash shell while it is running, and it is written to the .bash_history file when the shell exits or when the history -a or -w options are used. The history command can be used to display, manipulate, or search the Bash history. The HISTFILE variable can be used to change the name or location of the .bash_history file. The HISTSIZE and HISTFILESIZE variables can be used to change the number of commands that are stored in the Bash history and the .bash_history file, respectively.
The other files are incorrect for the following reasons:
References:
What is true regarding UEFI firmware? (Choose two.)
It can read and interpret partition tables
It can use and read certain file systems
It stores its entire configuration on the /boot/ partition
It is stored in a special area within the GPT metadata
It is loaded from a fixed boot disk position
UEFI firmware is a software program that provides the interface between the hardware and the operating system on a computer. UEFI stands for Unified Extensible Firmware Interface and it is a replacement for the traditional BIOS (Basic Input/Output System). UEFI firmware has several advantages over BIOS, such asfaster boot times, better security, larger disk support, and graphical user interface. Some of the features of UEFI firmware are12:
The other options are false or irrelevant. UEFI firmware does not read and interpret partition tables, it relies on the operating system to do that. UEFI firmware does not store its entire configuration on the /boot/ partition, it stores some of its settings in the NVRAM (Non-Volatile Random Access Memory) on the motherboard and some of its files on the ESP. UEFI firmware is not stored in a special area within the GPT (GUID Partition Table) metadata, it is stored in a ROM chip and an ESP. GPT is a partitioning scheme that supports larger disks and more partitions than the legacy MBR scheme. References:
Which of the following are valid stream redirection operators within Bash? (Choose two.)
<
#>
%>
>>>
2>&1
The stream redirection operators within Bash are used to redirect the input and output of commands to files, devices, or other commands. The valid stream redirection operators within Bash are:
The other operators are not valid stream redirection operators within Bash. They will cause syntax errors or unexpected behavior. For example, #> is a comment followed by a redirection operator, %> is a modulo operator followed by a redirection operator, and >>> is a bitwise right shift operator followed by a redirection operator.
References:
Which of the following vi commands deletes two lines, the current and the following line?
d2
2d
2dd
dd2
de12
The correct answer is C, 2dd. This command will delete two lines, the current and the following line, in vi editor. The syntax of the command is:
[number]dd
The number specifies how many lines to delete, starting from the current line. The dd command deletes the lines and puts them in a buffer, which can be pasted later with the p command. If no number is given, the command will delete only the current line.
The other commands are incorrect for the following reasons:
d[motion]
The motion specifies how many characters to delete, starting from the current cursor position. The 2 motion means two characters to the right. The d command deletes the characters and puts them in a buffer, which can be pasted later with the p command.
dd[number]
The dd command deletes the current line and puts it in a buffer, which can be pasted later with the p command. The number specifies how many lines to move the cursor down, after deleting the current line. If no number is given, the command will move the cursor to the next line.
d[motion][number]
The d command deletes the characters specified by the motion and puts them in a buffer, which can be pasted later with the p command. The e motion means the end of the word. The number specifies the line number to move the cursor to, after deleting the characters.
References:
What is true regarding the command
ls > files
if files do not exist?
The output of ls is printed to the terminal
files is created and contains the output of ls
An error message is shown and ls is not executed
The command files is executed and receives the output of ls
Any output of ls is discarded
The command ls > files uses the output redirection operator > to send the output of the ls command to a file named files. If the file does not exist, it will be created and will contain the output of the ls command, which is the list of files and directories in the current working directory. This is explained in the first web search result 1 and the second web search result 2. References: 1: Input Output & Error Redirection in Linux [Beginner’s Guide] 2: Redirections (Bash Reference Manual)
Which program runs a command in specific intervals and refreshes the display of the program’s output? (Specify ONLY the command without any path or parameters.)
The program that runs a command in specific intervals and refreshes the display of the program’s output is watch. This command is used to run any designated command at regular intervals and displays the output of the command on the terminal window. It is useful when you have to execute a command repeatedly and watch the command output change over time. The syntax of the watch command is:
watch [options] command
The options can modify the behavior of the watch command, such as how to format the output, how to handle signals, or how to enable color. The command is the command that you want to run and monitor. The default interval between each execution of the command is 2 seconds, but you can change it with the -n or --interval option. For more help using the watch command and its options, run man watch or visit this link.
The command dbmaint & was used to run dbmaint in the background. However, dbmaint is terminated after logging out of the system. Which alternative dbmaint invocation lets dbmaint continue to run even when the user running the program logs out?
job –b dmaint
dbmaint &>/dev/pts/null
nohup dbmaint &
bg dbmaint
wait dbmaint
This command will run dbmaint in the background and make it immune to hangup signals, which means it will continue to run even when the user logs out of the system. The nohup command prefixes the command with nohup, which intercepts the SIGHUP signal that is sent to the process when the terminal sessionends. The output of the command is redirected to a file called nohup.out by default, unless specified otherwise. The & symbol puts the command in the background, allowing the user to run other commands in the same shell.
The other commands are incorrect for the following reasons:
References:
Which of the following commands prints a list of usernames (first column) and their primary group (fourth column) from the /etc/passwd file?
fmt –f 1,4 /etc/passwd
cut –d : -f 1,4 /etc/passwd
sort –t : -k 1,4 /etc/passwd
paste –f 1,4 /etc/passwd
split –c 1,4 /etc/passwd
The command that prints a list of usernames (first column) and their primary group (fourth column) from the /etc/passwd file is cut -d : -f 1,4 /etc/passwd. The cut command is used to extract selected fields or characters from each line of a file or standard input. The -d or --delimiter option specifies the character that separates the fields, which in this case is a colon (:). The -f or --fields option specifies the fields to be printed, which in this case are the first and the fourth fields. The /etc/passwd file is a text file that contains information about the user accounts on the system, such as the username, password, user ID, group ID, home directory, and login shell. The first column of the file is the username and the fourth column is the group ID, which corresponds to the primary group of the user. The cut command will print these two columns separated by a colon for each line of the file. For example, running cut -d : -f 1,4 /etc/passwd will produce an output like this:
root:0 daemon:1 bin:1 sys:3 sync:4 games:5 man:12 lp:7 mail:8 news:9 uucp:10 proxy:13 www-data:33 backup:34 list:38 irc:39 gnats:41 nobody:65534 systemd-network:100 systemd-resolve:101 syslog:102 messagebus:103 _apt:104 lxd:105 uuidd:106 dnsmasq:107 sshd:108 pollinate:109 vboxadd:999 ubuntu:1000
The other commands are either invalid or do not perform the desired task. The fmt command is used to reformat paragraphs of text, but it does not have a -f option. The sort command is used to sort lines of text, but it does not have a -t option. The paste command is used to merge lines of files, but it does not have a -f option. The split command is used to split a file into pieces, but it does not have a -c option. References:
Consider the following directory:
drwxrwxr-x 2 root sales 4096 Jan 1 15:21 sales
Which command ensures new files created within the directory sales are owned by the group sales? (Choose two.)
chmod g+s sales
setpol –R newgroup=sales sales
chgrp –p sales sales
chown --persistent *.sales sales
chmod 2775 sales
The command chmod g+s sales sets the setgid bit on the directory sales, which means that any new file or subdirectory created within sales will inherit the group ownership of the directory. The command chmod 2775 sales does the same thing, but also sets the permissions of the directory to rwxrwxr-x, whichmeans that the owner, group, and others can read, write, and execute files in the directory. Both commands ensure that new files created within the directory sales are owned by the group sales. The other commands are either invalid or do not affect the group ownership of new files. References:
Which umask value ensures that new directories can be read, written and listed by their owning user, read and listed by their owning group and are not accessible at all for everyone else?
0750
0027
0036
7640
0029
The umask value is a four-digit octal number that determines the default permissions for new files and directories created by a user. The umask value specifies the permissions that are not granted to the user, group, and others. The permissions are represented by three bits for each category, where 1 means execute, 2 means write, and 4 means read. The sum of these values indicates the combination of permissions. For example, 7 means read, write, and execute; 6 means read and write; 5 means read and execute; 4 means read only; 3 means write and execute; 2 means write only; 1 means execute only; and 0 means no permission.
The umask value is subtracted from the maximum permissions for files and directories, which are 666 and 777, respectively. The maximum permissions are then converted to binary and bitwise ANDed with the bitwise complement of the umask value. The result is the default permissions for the new files and directories. For example, if the umask value is 0027, the default permissions for a new file are:
666 - 027 = 639 639 in octal = 110 011 001 in binary 027 in octal = 000 010 111 in binary Bitwise complement of 027 = 111 101 000 in binary 110 011 001 AND 111 101 000 = 110 001 000 in binary 110 001 000 in binary = 608 in octal 608 in octal = rw- — —
The default permissions for a new directory are:
777 - 027 = 750 750 in octal = 111 101 000 in binary 027 in octal = 000 010 111 in binary Bitwise complement of 027 = 111 101 000 in binary 111 101 000 AND 111 101 000 = 111 101 000 in binary 111 101 000 in binary = 750 in octal 750 in octal = rwx r-x —
Therefore, the umask value of 0027 ensures that new files can be read and written by their owning user, and are not accessible at all for everyone else. New directories can be read, written and listed by their owning user, read and listed by their owning group, and are not accessible at all for everyone else.
References:
In order to display all currently mounted filesystems, which of the following commands could be used? (Choose TWO correct answers.)
cat /proc/self/mounts
free
mount
lsmounts
cat /proc/filesystems
The correct commands to display all currently mounted filesystems are cat /proc/self/mounts and mount. The cat /proc/self/mounts command reads the contents of the /proc/self/mounts file, which is a symbolic link to /proc/mounts. This file contains information about all the filesystems that are currently mounted on the system, as reported by the kernel. The mount command without any arguments shows all the mounted filesystems, as recorded by the mount and umount commands. The other options are incorrect because they do not display the mounted filesystems. The free command shows the amount of free and used memory in the system. The lsmounts command is not a standard Linux command. The cat /proc/filesystems command shows the filesystem types that are supported by the kernel. References:
Which of the following commands will change the quota for a specific user?
edquota
repquota
quota -e
quota
The correct command to change the quota for a specific user is edquota. This command allows you to edit the quota limits for a user, a group, or a file set. You can specify the name of the user that you want to edit the quotas for after the command. For example, to change the disk quota for user ‘linuxconfig’, you can use the following command:
sudo edquota -u linuxconfig
This command will open an editor with the current quota information for the user ‘linuxconfig’. You can modify the soft and hard limits for the block and inode usage as per your requirements. You can also use the -p option to copy the quota settings from another user. For example, to copy the quota settings from user ‘ramesh’ to user ‘linuxconfig’, you can use the following command:
sudo edquota -p ramesh -u linuxconfig
The other commands are not suitable for changing the quota for a specific user. The repquota command displays a summary of the current quota usage and limits for the users or groups. The quota -e command turns off the disk quota for the current user. The quota command shows the disk quota and usage for the current user or for the users specified on the command line. For more information on how to use disk quota on Linux, you can refer to the following articles:
After successfully creating a hard link called bar to the ordinary file foo, foo is deleted from the filesystem. Which of the following describes the resulting situation?
foo and bar would both be removed.
foo would be removed while bar would remain accessible.
foo would be removed. bar would still exist but would be unusable.
Both foo and bar would remain accessible.
The user is prompted whether bar should be removed, too.
A hard link is a directory entry that refers to the same inode as another file. An inode is a data structure that stores the metadata and the location of the data blocks of a file. A hard link allows multiple names to refer to the same file content, as long as they are on the same filesystem. Therefore, when a hard link is created, the inode reference count is increased by one, and when a hard link is deleted, the inode reference count is decreased by one. The file content is only removed from the disk when the inode reference count reaches zero, meaning that there are no more hard links to the file. In this scenario, after successfully creating a hard link called bar to the ordinary file foo, foo and bar both refer to the same inode and the same file content. The inode reference count is two. When foo is deleted from the filesystem, the inode reference count is decreased by one, but it is still one, meaning that there is still one hard link to the file. Therefore, foo would be removed while bar would remain accessible. The file content would not be removed from the disk until bar is also deleted. The other options are either incorrect or not applicable. The user is not prompted whether bar should be removed, too. The bar link would still exist and be usable, not unusable. References:
Which command shows all shared libraries required by a binary executable or another shared library? (Specify ONLY the command without any path or parameters.)
The command that shows all shared libraries required by a binary executable or another shared library is ldd. This command queries the dynamic linker to find out which libraries are needed by the given file and displays them on the standard output. For example, to see the shared libraries required by the /bin/ls program, we can run:
ldd /bin/ls
The output will look something like this:
linux-vdso.so.1 (0x00007ffd8a7f6000)libselinux.so.1 => /lib/x86_64-linux-gnu/libselinux.so.1 (0x00007f0c5a6c4000)libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f0c5a4d3000)libpcre2-8.so.0 => /usr/lib/x86_64-linux-gnu/libpcre2-8.so.0 (0x00007f0c5a445000)libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f0c5a441000)/lib64/ld-linux-x86-64.so.2 (0x00007f0c5a8a5000)libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f0c5a41e000)
The output shows the name and the path of each shared library, as well as the address where it is loaded in memory. If the library is not found, the output will show not found instead of the path. The linux-vdso.so.1 library is a special case, as it is a virtual library that is not actually present on the filesystem, but is injected by the kernel into every process12.
References:
Which of the following partition types is used for Linux swap spaces when partitioning hard disk drives?
82
83
8e
fd
7
 Linux swap spaces are designated as type 82 on MBR (Master Boot Record) partition tables, which are used to store information about the partitions on a hard disk drive. This type code identifies the partition as a Linux swap area, which can be used by the Linux kernel to supplement the system RAM by holding idle memory pages. The mkswap command can be used to initialize a partition of type 82 as a swap partition. Other type codes are used for different purposes, such as 83 for Linux native partitions, 8e for Linux LVM partitions, fd for Linux RAID partitions, and 7 for NTFS partitions. References:
Which of the following commands changes the ownership of file.txt to the user dan and the group staff?
chown dan/staff file.txt
chown dan:staff file.txt
chown -u dan -g staff file.txt
chown dan -g staff file.txt
The correct command to change the ownership of file.txt to the user dan and the group staff is chown dan:staff file.txt. This command uses the colon (:) as a separator between the user and the group. The other options are incorrect because they use the wrong syntax or options for the chown command.Option A uses a slash (/) instead of a colon, which is not valid. Option C uses the -u and -g options, which are not supported by the chown command. Option D uses the -g option, which only changes the group, not the user. References:
The system configuration file named _______ is commonly used to set the default runlevel. (Please provide the file name with full path information)
The system configuration file named /etc/inittab is commonly used to set the default runlevel. This file contains information about the initialization process of the system, and it defines the default runlevel, the available runlevels, and the actions to be taken when entering or leaving a runlevel. The default runlevel is the mode of operation that the system starts up into, and it determines which services and processes are running. The default runlevel is specified by a line similar to the following in the /etc/inittab file:
id:5:initdefault:
The number after the first colon indicates the default runlevel, which can range from 0 to 6. The meaning of each runlevel is:
To change the default runlevel, edit the /etc/inittab file as root and change the number to the desired runlevel. For example, to change the default runlevel to 3, use the following command:
sudo nano /etc/inittab
And change the line to:
id:3:initdefault:
Then save and exit the file. The changes will take effect on the next reboot.
References:
Which utility would be used to change how often a filesystem check is performed on an ext2 filesystem without losing any data stored on that filesystem?
mod2fs
fsck
tune2fs
mke2fs
fixe2fs
The utility that can be used to change how often a filesystem check is performed on an ext2 filesystem without losing any data stored on that filesystem is tune2fs. This command can adjust various parameters of a Linux ext2, ext3, or ext4 filesystem, such as the maximum mount count, the check interval, the reserved blocks percentage, and the default mount options. To change the check interval, the -i option can be used, followed by a time value. For example, to set the check interval to 180 days for the filesystem on /dev/sda1, the following command can be used:
sudo tune2fs -i 180d /dev/sda1
This command will modify the superblock of the filesystem, which contains the metadata and configuration information, without affecting the data stored on the filesystem. The other options are incorrect because they are not suitable for changing the check interval of an ext2 filesystem. Option A is wrong because there is no such utility as mod2fs. Option B is wrong because fsck is a utility for checking and repairing filesystems, not changing their parameters. Option D is wrong because mke2fs is a utility for creating ext2 filesystems, which will erase the existing data on the partition. Option E is wrong because there is no such utility as fixe2fs.
For more information on how to use the tune2fs command, you can refer to the following articles:
In compliance with the FHS, in which of the following directories are documentation files found?
/usr/share/documentation
/usr/local/share/documentation
/var/share/doc
/usr/share/doc
/etc/share/doc
 According to the FHS (Filesystem Hierarchy Standard), the /usr/share/doc directory is used to store documentation files for various packages installed on the system. The documentation files may include README files, manuals, license agreements, changelogs, etc. The /usr/share/doc directory is intended to be read-only and independent of the machine architecture. The other directories are not compliant with the FHS or do not exist by default. The /usr/share/documentation directory is not a standard directory and may not be recognized by some applications. The /usr/local/share/documentation directory is also not a standard directory and may conflict with the /usr/local/share/doc directory, which is used for documentation files for locally installed packages. The /var/share/doc directory does not exist by default and is not a valid subdirectory of /var, which is used for variable data files. The /etc/share/doc directory does not exist by default and is not a valid subdirectory of /etc, which is used for configuration files. References:
Which permissions and ownership should the file /etc/passwd have?
-rw-------1 rootroot531 Jun 5 22:45 /etc/passwd
-rw-r--r--1 rootroot531 Jun 5 22:45 /etc/passwd
-rw-r--r--1 11531 Jun 5 22:45 /etc/passwd
-rw-------1 11531 Jun 5 22:45 /etc/passwd
The correct permissions and ownership for the file /etc/passwd are:
B. -rw-r–r-- 1 root root 531 Jun 5 22:45 /etc/passwd
The /etc/passwd file is a plain text-based database that contains information for all user accounts on the system. It is owned by root and has 644 permissions. The file can only be modified by root or users with sudo privileges and readable by all system users. The permissions and ownership of the file are important for the security and functionality of the system. The permissions and ownership of the file can be viewed by using the ls -l command. For example:
ls -l /etc/passwd
The output of the command will show the following information:
-rw-r–r-- 1 root root 531 Jun 5 22:45 /etc/passwd
The first column shows the permissions of the file, which are composed of 10 characters. The first character indicates the file type, which is - for regular files. The next nine characters indicate the permissions for the user (owner), the group, and the others, respectively. Each set of three characters indicates the read ®, write (w), and execute (x) permissions. A dash (-) means no permission. In this case, the permissions are:
The second and third columns show the owner and the group of the file, which are both root. The root user is the superuser or the administrator of the system, who has full access and control over the system. The root group is the primary group of the root user, which usually has no other members.
The fourth column shows the size of the file in bytes, which is 531 in this case. The fifth and sixth columns show the date and time of the last modification of the file, which are Jun 5 22:45 in this case. The last column shows the name of the file, which is /etc/passwd in this case.
The other options are not correct because:
Which of the following describes the correct order in which the components of the system boot process are started?
BIOS, kernel, bootloader, init system
BIOS, bootloader,kernel, init system
Bootloader, BIOS, kernel, init system
BIOS, bootloader, init system, kernel
Bootloader, BIOS, init system, kernel
The system boot process is the sequence of steps that the system follows when it is powered on or restarted. The system boot process can be divided into four main components: BIOS, bootloader, kernel, and init system. The order in which these components are started is:
Some common init systems for Linux systems are SysVinit, systemd, and Upstart.
References:
What do the permissions -rwSr-xr-x mean for a binary file when it is executed as a command?
The command is SetUID and it will be executed with the effective rights of the owner.
The command will be executed with the effective rights of the group instead of the owner.
The execute flag is not set for the owner. Therefore, the SetUID flag is ignored.
The command will be executed with the effective rights of the owner and group.
The permissions -rwSr-xr-x mean that the file is readable and writable by the owner, readable and executable by the group, and readable and executable by others. The S in the owner’s permissions indicates that the file has the SetUID bit set, which means that when the file is executed as a command, it will run with the effective user ID of the file owner, rather than the user who executed it. This allows the command to perform privileged operations that the user normally cannot do. For example, the /bin/passwd commandhas the SetUID bit set, so that it can modify the /etc/shadow file, which is only writable by root. References: LPI Linux Administrator, File Permissions and Attributes
Which of the following commands will load a kernel module along with any required dependency modules?
depmod
insmod
modprobe
module_install
loadmod
The modprobe command is used to add or remove modules from the Linux kernel. The modprobe command can automatically resolve and load the dependencies of a module, which are the other modules that the module depends on. The modprobe command reads the modules.dep file, which is generated by the depmod command, to determine the dependencies of a module. The syntax of the modprobe command is:
modprobe [options] module [module parameters]
The module is the name of the module to be loaded or removed. The module parameters are optional arguments that can modify the behavior of the module. The options are optional, and they can modify the behavior of the modprobe command, such as displaying the dependencies, listing the modules, or specifying the configuration file.
For example, to load the e1000e module, which is a driver for Intel Gigabit Ethernet adapters, along with any required dependency modules, use the following command:
modprobe e1000e
This command will load the e1000e module and any other modules that it depends on, such as the crc32c module. You can verify the loaded modules by using the lsmod command, which lists the modules and their dependencies, sizes, and usage counts.
The other options are not correct because:
References:
Which chown command will change the ownership to dave and the group to staff on a file named data.txt?
chown dave/staff data.txt
chown –u dave –g staff data.txt
chown --user dave --group staff data.txt
chown dave:staff data.txt
The chown command is used to change the owner and group of files and directories in Linux. The basic syntax of the chown command is:
chown [options] user[:group] file…
The user is the name or the numeric ID of the new owner of the file. The group is the name or the numeric ID of the new group of the file. The file is the name or the path of the file or directory to be changed. The user and group are separated by a colon (:), not a slash (/). The group is optional, and if it is omitted, the group will not be changed. The options are optional, and they can modify the behavior of the chown command, such as changing the ownership recursively, silently, or verbosely.
In this question, the user is dave and the group is staff. The file is data.txt. Therefore, the correct command to change the ownership to dave and the group to staff on data.txt is:
chown dave:staff data.txt
This command will change the owner of data.txt to dave and the group of data.txt to staff. You can verify the changes by using the ls -l command to view the owner and group of data.txt.
The other options are not correct because:
chown: invalid user: ‘dave/staff’
chown: invalid option – ‘u’ Try ‘chown --help’ for more information.
chown: unrecognized option ‘–user’ Try ‘chown --help’ for more information.
References:
Which of the following commands creates an ext3 filesystem on /dev/sdb1? (Choose TWO correct answers.)
/sbin/mke2fs -j /dev/sdb1
/sbin/mkfs -t ext3 /dev/sdb1
/sbin/mkfs -c ext3 /dev/sdb1
/sbin/mke3fs -j /dev/sdb1
The correct commands to create an ext3 filesystem on /dev/sdb1 are /sbin/mke2fs -j /dev/sdb1 and /sbin/mkfs -t ext3 /dev/sdb1. These commands format the partition /dev/sdb1 with the ext3 filesystem type. The first command uses the mke2fs utility with the -j option, which enables journaling. The second command uses the mkfs utility with the -t option, which specifies the filesystem type. Both commands are equivalent and can be used interchangeably. The other options are incorrect because they use the wrong syntax or parameters for the commands. Option C is wrong because the -c option for the mkfs command checks the device for bad blocks, not the filesystem type. Option D is wrong because there is no such utility as mke3fs. The correct utility name is mke2fs.
To what environment variable will you assign or append a value if you need to tell the dynamic linker to look in a build directory for some of a program's shared libraries?
LD_LOAD_PATH
LD_LIB_PATH
LD_LIBRARY_PATH
LD_SHARE_PATH
LD_RUN_PATH
 The environment variable LD_LIBRARY_PATH is used to tell the dynamic linker to look in a specific directory for some of a program’s shared libraries. It is a colon-separated list of directories that are searched by the dynamic linker when looking for a shared library to load1. The directories are searched in the order they are mentioned in. For example, if we have a program that depends on a shared library libfoo.so that is located in /home/user/build/lib, we can run the program with:
LD_LIBRARY_PATH=/home/user/build/lib ./program
This will instruct the dynamic linker to search for libfoo.so in /home/user/build/lib before the default directories. The environment variable LD_LIBRARY_PATH can also be appended to an existing value with the += operator, for example:
LD_LIBRARY_PATH+=:/home/user/build/lib
This will add /home/user/build/lib to the end of the LD_LIBRARY_PATH list. The other options are not valid environment variables for the dynamic linker. LD_LOAD_PATH, LD_LIB_PATH, and LD_SHARE_PATH are not recognized by the dynamic linker. LD_RUN_PATH is a linker option that can be used to embed a librarysearch path in the executable at link time, but it is not an environment variable that can be set or modified at run time2. References:
Typically, which top level system directory is used for files and data that change regularly while the system is running and are to be kept between reboots? (Specify only the top level directory)
/var
/var/,
Var
var/
The top-level system directory that is used for files and data that change regularly while the system is running and are to be kept between reboots is /var. The /var directory contains variable data that changes in size as the system runs. For instance, log files, mail directories, databases, and printing spools are stored in /var. These files and data are not temporary and need to be preserved across system reboots. The /var directory is one of the few directories that are recommended to be on a separate partition, according to the Filesystem Hierarchy Standard (FHS)1. This is because the /var directory can grow unpredictably and fill up the / partition, which can cause system instability or failure. By having /var on a separate partition, we can limit the amount of disk space that can be used by variable data and prevent users from affecting the / partition. The /var directory is also a common target for malicious attacks, so having it on a separate partition can improve the security and isolation of the system. References:
Which option to the yum command will update the entire system? (Specify ONLY the option name without any additional parameters.)
The yum command is a tool for managing software packages on Red Hat Enterprise Linux and other RPM-based systems. The yum update option will update the entire system by checking the versions of the installed packages and installing the latest available versions from the repositories. The yum upgrade option will do the same, but it will also remove any obsolete packages that are no longer needed by the system. Both options will prompt the user to confirm before proceeding with the update or upgrade process. References:
When using rpm --verify to check files created during the installation of RPM packages, which of the following information is taken into consideration? (Choose THREE correct answers.)
Timestamps
MD5 checksums
Inodes
File sizes
GnuPG signatures
 When using rpm --verify to check files created during the installation of RPM packages, the following information is taken into consideration:
RPM does not take into consideration the following information:
References:
Which RPM command will output the name of the package which supplied the file /etc/exports?
rpm -F /etc/exports
rpm -qf /etc/exports
rpm -Kl /etc/exports
rpm -qp /etc/exports
rpm -qi/etc/exports
 The RPM command that will output the name of the package which supplied the file /etc/exports is rpm -qf /etc/exports. This command will query the RPM database and find the package that owns or provides the file /etc/exports1. The output will show the package name, version, release, and architecture. For example:
The other options are incorrect for the following reasons:
References:
Which of the following commands lists all currently installed packages when using RPM package management?
yum --query --all
yum --list --installed
rpm --query --all
rpm --list –installed
 The command that lists all currently installed packages when using RPM package management is rpm --query --all. This command displays information about all the packages that are currently installed on the system, including their name, version, release, and architecture1. The output can be customized by using various query options and format specifiers2.
The other commands are either invalid or related to YUM, not RPM. yum --query --all is not a valid YUM command, as YUM does not have a --query option3. yum --list --installed is a valid YUM command, but itlists the packages from the YUM repositories, not the RPM database3. rpm --list --installed is not a valid RPM command, as RPM does not have a --list option2.
References:
Which of the following options is used in a GRUB Legacy configuration file to define the amount of time that the GRUB menu will be shown to the user?
hidemenu
splash
timeout
showmenu
The timeout option in a GRUB Legacy configuration file is used to define the amount of time (in seconds) that the GRUB menu will be shown to the user before booting the default entry. The timeout option is usually located in the /boot/grub/menu.lst file. For example, timeout 10 will display the GRUB menu for 10 seconds. To disable the timeout and wait for user input indefinitely, the value of timeout can be set to -1. To boot immediately without displaying the menu, the value of timeout can be set to 0. The other options are not valid for the GRUB Legacy configuration file. References:
Which of the following commands overwrites the bootloader located on /dev/sda without overwriting the partition table or any data following it?
dd if=/dev/zero of=/dev/sda bs=512
dd if=/dev/zero of=/dev/sda bs=512 count=1
dd if=/dev/zero of=/dev/sda bs=440 count=1
dd if=/dev/zero of=/dev/sda bs=440
The dd command is used to copy data from one device or file to another, with optional parameters to specify the block size (bs), the number of blocks to copy (count), and other options. The bootloader is typically located in the first 440 bytes of the disk, which is the Master Boot Record (MBR) area. The MBR also contains the partition table, which starts at byte 446 and occupies 64 bytes. Therefore, to overwrite the bootloader without affecting the partition table or any data following it, the command should copy 440 bytes from /dev/zero (a special device that provides null bytes) to /dev/sda (the disk device) and stop after one block. This is achieved by the command: dd if=/dev/zero of=/dev/sda bs=440 count=1Â References:
Which Debian package management tool asks the configuration questions for a specific already installed package just as if the package were being installed for the first time? (Specify ONLY the command without any path or parameters.)
The command dpkg-reconfigure is a Debian package management tool that asks the configuration questions for a specific already installed package just as if the package were being installed for the first time. It can be used to reconfigure a package that was previously installed with default settings, or to change the settings of a package that requires user input during installation. It can also be used to fix a broken configuration file or to restore the original configuration file of a package. References:
The dpkg-____ command will ask configuration questions for a specified package, just as if the package were being installed for the first time.
 The dpkg-reconfigure command is used to reconfigure an already installed package. It asks configuration questions for the package, just as if the package were being installed for the first time. This can be useful if the user wants to change some settings or options for the package without reinstalling it. The dpkg-reconfigure command can also be used to fix a broken package configuration or to restore the default settings. References:
To prevent users from being able to fill up the / partition, the ____________ directory should be on a separate partition if possible because it is world writeable.
/tmp
tmp
The /tmp directory should be on a separate partition if possible because it is world writable. This means that any user can create, modify, or delete files and directories in /tmp. This can pose a risk of filling up the / partition, which can cause system instability or failure. By having /tmp on a separate partition, we can limit the amount of disk space that can be used by temporary files and prevent users from affecting the / partition. The /tmp directory is also a common target for malicious attacks, so having it on a separate partition can improve the security and isolation of the system. The /tmp directory is one of the few directories that are world writable by default, according to the Filesystem Hierarchy Standard (FHS)1. The other directories that are usually world writable are /var/tmp and /var/lock, which are also used for temporary or lock files. However, these directories are not as frequently used or as large as /tmp, so they are less likely to fill up the / partition. The /tmp directory also has the sticky bit set, which means that only the owner of a file or directory can delete or rename it2. This prevents users from deleting or modifying other users’ files in /tmp. However, this does not prevent users from creating new files or directories in /tmp, which can still consume disk space and resources. Therefore, it is advisable to have /tmp on a separate partition if possible. References:
Which file should be edited to select the network locations from which Debian installation package files are loaded?
/etc/dpkg/dpkg.cfg
/etc/apt/apt.conf
/etc/apt/apt.conf.d
/etc/apt/sources.list
/etc/dpkg/dselect.cfg
The /etc/apt/sources.list file is the main configuration file for the Advanced Package Tool (apt), which is used to manage Debian installation package files. This file contains a list of repositories, or sources, from which apt can download and install packages. Each repository is specified by a line that has the following format:
type uri suite [component1] [component2] […]
Where:
For example, a typical sources.list file for Debian stable could look like this:
deb http://deb.debian.org/debian stable main contrib non-free deb-src http://deb.debian.org/debian stable main contrib non-free
deb http://deb.debian.org/debian-security/ stable/updates main contrib non-free deb-src http://deb.debian.org/debian-security/ stable/updates main contrib non-free
deb http://deb.debian.org/debian stable-updates main contrib non-free deb-src http://deb.debian.org/debian stable-updates main contrib non-free
The first two lines specify the main repository for Debian stable, with both binary (deb) and source (deb-src) packages. The next two lines specify the security updates repository for Debian stable, which contains important security fixes. The last two lines specify the stable-updates repository, which contains packages that have been updated after the release of Debian stable.
By editing the /etc/apt/sources.list file, one can select the network locations from which Debian installation package files are loaded. However, it is recommended to use a graphical or command-line tool, such as aptitude or synaptic, to manage the sources.list file, as they can handle the syntax and avoid errors.
References:
What is the difference between the --remove and the --purge action with the dpkg command?
--remove removes the program, --purge also removes the config files
--remove only removes the program, --purge only removes the config files
--remove removes a package, --purge also removes all packages dependent on it
--remove removes only the package file itself, --purge removes all files related to the package
 The dpkg command is a tool to install, build, remove and manage Debian packages. The option --remove is used to remove an installed package, but it does not remove the configuration files that may have been modified by the user. The option --purge is used to remove an installed package and also delete its configuration files. This can be useful if the user wants to completely uninstall a package and start from scratch if it is reinstalled later. The syntax is: dpkg --remove package or dpkg --purge package. For example, dpkg --remove nginx will remove the nginx web server package, but it will leave the configuration files in /etc/nginxdpkg --purge nginx will remove the nginx package and also delete the configuration files in /etc/nginx1. The other options are not correct because:
Which of the following kernel parameters instructs the kernel to suppress most boot messages?
silent
verbose=0
nomesg
quiet
The quiet kernel parameter instructs the kernel to suppress most boot messages, except for critical errors12. The quiet parameter can be added to the GRUB_CMDLINE_LINUX_DEFAULT variable in the /etc/default/grub file and then run sudo update-grub to apply the changes3. The quiet parameter can also be used in combination with other parameters, such as splash, to enable a graphical boot screen4.
The other options in the question are not valid or do not have the same functionality as the quiet parameter:
References:
1: Getting the Kernel Command-Line Parameters | Baeldung on Linux 2: How to mute kernel messages at startup in Arch Linux? 3: boot - How to turn off the filesystem check message which occures while booting - Ask Ubuntu 4: [How to enable a graphical boot screen on Ubuntu 18.04 LTS - LinuxConfig.org] 5: [Kernel parameters - ArchWiki] : [Linux Kernel Parameters - SysTutorials]
You suspect that a new ethernet card might be conflicting with another device. Which file should you check within the /proc tree to learn which IRQs are being used by which kernel drivers?
The file that you should check within the /proc tree to learn which IRQs are being used by which kernel drivers is /proc/interrupts1 Comprehensive Explanation: The /proc/interrupts file is a virtual file that provides information about the number and type of interrupts per CPU per I/O device12. It displays the IRQ number, the number of that interrupt handled by each CPU core, the interrupt type, and a comma-delimited list of drivers that are registered to receive that interrupt12. For example, the following output shows the contents of /proc/interrupts on a system with two CPUs and several devices:
The first column shows the IRQ number, followed by one column for each CPU core showing the number of interrupts handled by that core. The last column shows the interrupt type and the driver name. Some interrupt types are:
To check if a new ethernet card might be conflicting with another device, you can look for the driver name of the ethernet card in the /proc/interrupts file and see if it shares the same IRQ number with another device. If so, you can try to change the IRQ assignment of the devices or use the smp_affinity file to control which CPU cores can handle the interrupt12.
References:
1: 4.3. Interrupts and IRQ Tuning - Red Hat Customer Portal 2: What are the non-numeric IRQs in /proc/interrupts?
What of the following statements are true regarding /dev/ when using udev? (Choose TWO correct answers.)
Entries for all possible devices get created on boot even if those devices are not connected.
Additional rules for udev can be created by adding them to /etc/udev/rules.d/.
When using udev, it is not possible to create block orcharacter devices in /dev/ using mknod.
The /dev/ directory is a filesystem of type tmpfs and is mounted by udev during system startup.
The content of /dev/ is stored in /etc/udev/dev and is restored during system startup.
 udev is a device manager that dynamically creates and removes device nodes in the /dev/ directory. It also handles device events, such as adding, removing, or changing the attributes of devices. udev uses rules to match devices and assign properties, permissions, names, symlinks, and other actions. The rules are stored in files under /lib/udev/rules.d/ and /etc/udev/rules.d/. The latter directory can be used to create additional or override existing rules. The /dev/ directory is not a regular directory on the root filesystem, but a virtual filesystem of type tmpfs that is mounted by udev during system startup. tmpfs is a filesystem that resides in memory and can grow and shrink dynamically. The content of /dev/ is not stored in /etc/udev/dev, but is created by udev based on the rules and the available devices. udev does not prevent the creation of block or character devices in /dev/ using mknod, but it may overwrite or remove them if they conflict with the rules or the device events. References: LPI Linux Essentials - 1.101.2, LPI Linux Administrator - 102.4
Which file in the /proc filesystem lists parameters passed from the bootloader to the kernel? (Specify the file name only without any path.)
The file in the /proc filesystem that lists the parameters passed from the bootloader to the kernel is /proc/cmdline. This file contains a single line of text that shows the command line arguments that were used to boot the kernel. These arguments can include various options, such as the root device, the init process, the console device, and more. The /proc/cmdline file is read-only and cannot be modified at runtime. The parameters in this file are determined by the bootloader configuration, such as GRUB or LILO, and can be changed by editing the corresponding files12.
References: 1: The /proc Filesystem — The Linux Kernel documentation 2: passing bootloader arguments to the kernel - Unix & Linux Stack Exchange
You are having some trouble with a disk partition and you need to do maintenance on this partition but your users home directories are on it and several are logged in. Which command would disconnect the users and allow you to safely execute maintenance tasks?
telinit 1
shutdown -r now
killall -9 inetd
/bin/netstop --maint
/etc/rc.d/init.d/network stop
The command that would disconnect the users and allow you to safely execute maintenance tasks on a disk partition is telinit 112. The telinit command is used to change the runlevel of the system, which is a mode of operation that defines what processes and services are running3. The runlevel 1, also known as single-user mode, is a mode that allows only the root user to log in, and disables all network services and graphical interfaces4. This mode is useful for performing system maintenance and recovery tasks, such as repairing a disk partition5.
The other options in the question are not correct because:
References:
1: How to Change Runlevels (targets) in SystemD - Tecmint 2: How to Boot into Single User Mode in CentOS/RHEL 7 - Tecmint 3: Runlevel - Wikipedia 4: Single-user mode - Wikipedia 5: How to Repair a Corrupted Linux File System - Linux.com : [shutdown(8) - Linux manual page] : [inetd(8) - Linux manual page] : [How to Start/Stop or Enable/Disable firewalld on CentOS 7 - Tecmint]
Which of the following statements is correct when talking about /proc/?
All changes to files in /proc/ are stored in /etc/proc.d/ and restored on reboot.
All files within /proc/ are read-only and their contents cannot be changed.
All changes to files in /proc/ are immediately recognized by the kernel.
All files within /proc/ are only readable by the root user.
The /proc/ directory is a virtual filesystem that provides a view of the kernel’s data structures and parameters. It contains information about processes, hardware, memory, modules, and other aspects of thesystem. The files in /proc/ are not stored on disk, but are generated on the fly by the kernel when they are accessed. Therefore, any changes to files in /proc/ are immediately recognized by the kernel and affect its behavior. For example, writing a value to /proc/sys/kernel/hostname will change the system’s hostname without rebooting. The files in /proc/ are not all read-only; some of them can be modified by the root user or by processes with the appropriate permissions. The files in /proc/ are readable by any user, unless restricted by the kernel or by the mount options. References: LPI Linux Essentials - 1.101.2, LPI Linux Administrator - 102.3
The system is having trouble and the engineer wants to bypass the usual /sbin/init start up and run /bin/sh. What is the usual way to pass this change to the kernel from your boot loader?
Start in runlevel 1.
Pass init=/bin/sh on the kernel parameter line.
Pass /bin/sh on the kernel parameter line.
Pass start=/bin/sh on the kernel parameter line.
The usual way to pass this change to the kernel from the boot loader is to pass init=/bin/sh on the kernel parameter line12. The init kernel parameter is used to specify the program that is run as the first process after the kernel is loaded3. By default, this program is /sbin/init, which is responsible for starting and managing other processes and services4. However, by passing init=/bin/sh, the kernel will run /bin/sh instead, which is a shell program that allows the user to execute commands interactively or from a script5. This way, the user can bypass the usual initialization process and run /bin/sh as the root user, which can be useful for troubleshooting or recovery purposes12.
The other options in the question are not correct because:
References:
1: How to pass arguments to a Linux kernel init= bootparam? - Unix & Linux Stack Exchange 2: kernel parameter init=/bin/bash not working? (RHEL7, RHCSA test) - Unix & Linux Stack Exchange 3: The kernel’s command-lineparameters — The Linux Kernel documentation 4: [init - Wikipedia] 5: [sh - Wikipedia] : [Single-user mode - Wikipedia] : How to Change Runlevels (targets) in SystemD - Tecmint
During a system boot cycle, what program is executed after the BIOS completes its tasks?
The bootloader
The inetd program
The init program
The kernel
The bootloader is a program that is executed by the BIOS after it completes its tasks of initializing the hardware and performing the POST (Power-On Self Test). The bootloader is responsible for loading the kernel and other necessary files into memory and passing control to the kernel. The bootloader can be either installed in the Master Boot Record (MBR) of the disk or in a separate partition. Some examples of bootloaders are GRUB, LILO, and SYSLINUX. References: LPI Linux Essentials - 1.101.1, LPI Linux Administrator - 102.1
Which run levels should never be declared as the default run level when using SysV init? (Choose TWO correct answers.)
0
1
3
5
6
 Run levels are predefined modes of operation in the SysV init system that determine which processes and services are started or stopped. The default run level is the one that the system enters after booting. It is usually specified in the /etc/inittab file with a line like id:5:initdefault:. The run levels 0 and 6 should never be declared as the default run level because they are used to halt and reboot the system, respectively. If they are set as the default, the system will enter an endless loop of shutting down and restarting. The other run levels (1-5) have different meanings depending on the distribution, but they usually correspond to single-user mode, multi-user mode, network mode, graphical mode, etc. References: LPI Linux Essentials - 1.101.2, LPI Linux Administrator - 101.3
Which of the following information is stored within the BIOS? (Choose TWO correct answers.)
Boot device order
Linux kernel version
Timezone
Hardware configuration
The system's hostname
 The BIOS (Basic Input/Output System) is a firmware that is stored in a ROM chip on the motherboard and is responsible for initializing the hardware and loading the bootloader. The BIOS has a setup utility that allows the user to configure various settings, such as the boot device order, the hardware configuration, the system date and time, the security options, etc. The BIOS does not store information about the Linux kernel version, the time zone, or the system’s hostname, as these are part of the operating system and are not relevant for the BIOS. References: LPI Linux Essentials - 1.101.1, LPI Linux Administrator - 102.1
The message "Hard Disk Error" is displayed on the screen during Stage 1 of the GRUB boot process. What does this indicate?
The kernel was unable to execute /bin/init
The next Stage cannot be read from the hard disk because GRUB was unable to determine the size and geometry of the disk
One or more of the filesystems on the hard disk has errors and a filesystem check should be run
The BIOS was unable to read the necessary data from the Master Boot Record to begin the boot process
The GRUB boot process consists of three stages1:
The message “Hard Disk Error†is displayed on the screen during Stage 1 of the GRUB boot process. This indicates that the next Stage (either Stage 1.5 or Stage 2) cannot be read from the hard disk because GRUB was unable to determine the size and geometry of the disk3. This could occur because the BIOS translated geometry has been changed by the user or the disk is moved to another machine or controller after installation, or GRUB was not installed using itself (if it was, the Stage 2 version of this error would have been seen during that process and it would not have completed the install)3.
The other options in the question are not correct because:
References:
1: GRUB - ArchWiki 2: GNU GRUB Manual 0.97 3: Stage1 errors - GNU GRUB Manual 0.97 4: [Kernel panic - Wikipedia] 5: [Stage2 errors - GNU GRUB Manual 0.97] 6: [Master Boot Record - Wikipedia] : How to Fix GRUB Load Errors and Recover Data? - MiniTool Home Data Recovery
What information can the lspci command display about the system hardware? (Choose THREE correct answers.)
Device IRQ settings
PCI bus speed
System battery type
Device vendor identification
Ethernet MAC address
The lspci command can display information about the system hardware, such as:
References: 1: https://www.man7.org/linux/man-pages/man8/lspci.8.html 2: https://phoenixnap.com/kb/lspci-command 3: https://en.wikipedia.org/wiki/Lspci