The USB device filesystem can be found under /proc/______/usb/. (Please fill in the blank with the single word only)
Correct Answer:
bus
Question 82
Which of the following commands brings a system running SysV init into a state in which it is safe to perform maintenance tasks? (Choose TWO correct answers.)
Correct Answer: B,D
Question 83
Immediately after deleting 3 lines of text in vi and moving the cursor to a different line, which single character command will insert the deleted content below the current line?
Correct Answer: C
Explanation The p command in vi inserts the content of the buffer below the current line. The buffer is where the deleted or yanked text is stored temporarily. The P command inserts the buffer above the current line. The i command enters the insert mode before the cursor position. The U command restores the current line to its original state. The u command undoes the last change made to the file. References: * [LPI Linux Essentials - 1.3 Basic Editing] * [LPI Linux Essentials - 1.4 I/O Redirection] * [LPI Linux Essentials - 1.5 Manage Simple Partitions and Filesystems]
Question 84
What is the purpose of the Bash built-in export command?
Correct Answer: D
Explanation The export command is a Bash built-in command that exports environment variables and functions for use in other shell sessions1. Environment variables are named values that affect the behavior of applications and processes2. For example, the PATH variable stores a list of directories where executable programs are located, and the LANG variable sets the language and locale of the system2. By using the export command, you can make these variables available to any child process spawned by the current shell1. For example, if you want to set the EDITOR variable to vim for all subshells, you can run: export EDITOR=vim The export command can also be used to export functions, which are blocks of code that can be reused by invoking their name3. For example, if you want to create and export a function that prints "Hello world", you can run: hello () { echo "Hello world"; } export -f hello Then, you can call the hello function in any subshell or script that inherits the environment from the current shell. The other options are not related to the export command. Option A refers to the mount command, which attaches a filesystem to a directory4. Option B refers to the command substitution feature, which runs a command in a subshell and replaces it with its output5. Option C refers to the history command, which displays the command history of the current shell. Option E refers to the exportfs command, which maintains the table of exported NFS shares. References: * [LPI Linux Essentials - 1.3 Basic Editing] * [LPI Linux Essentials - 1.4 I/O Redirection] * [LPI Linux Essentials - 1.5 Manage Simple Partitions and Filesystems] * Linux export Command with Examples - phoenixNAP * bash - What does "export" do in shell programming? - Stack Overflow * How to Use Export Command in Linux [Explained for Beginners] * mount(8) - Linux manual page * Command Substitution - Bash Reference Manual * [history(3) - Linux manual page] * [exportfs(8) - Linux manual page]
Question 85
Regarding the command: nice -5 /usr/bin/prog Which of the following statements is correct?
Correct Answer: B
Explanation The nice command is used to start a process with a modified scheduling priority. The scheduling priority is a value that determines how much CPU time a process will receive from the kernel. The lower the priority, the more CPU time a process will get. The priority is also known as the nice value, because a process with a high nice value is being nice to other processes by giving up CPU time. The nice value ranges from -20 to 19, with -20 being the highest priority and 19 being the lowest. By default, processes are started with a nice value of 0, which means normal priority. The nice command takes an optional argument -n followed by a number, which specifies the increment or decrement of the nice value from the default value of 0. For example, the command: nice -n 5 /usr/bin/prog will start the /usr/bin/prog process with a nice value of 5, which means a lower priority than the default. Similarly, the command: nice -n -5 /usr/bin/prog will start the /usr/bin/prog process with a nice value of -5, which means a higher priority than the default. If the -n argument is omitted, the nice command will assume a default increment of 10. For example, the command: nice /usr/bin/prog will start the /usr/bin/prog process with a nice value of 10, which means a very low priority. Note that only the root user can start a process with a negative nice value, as this requires special privileges. Therefore, the command: nice -5 /usr/bin/prog is equivalent to: nice -n -5 /usr/bin/prog and will start the /usr/bin/prog process with a nice value of -5, which means a higher priority than the default. This means that the correct answer is B. /usr/bin/prog is executed with a nice level of 5. References: * [LPI Exam 101 Detailed Objectives], Topic 103: GNU and Unix Commands, Objective 103.6: Modify process execution priorities, Weight: 2, Key Knowledge Areas: Know the default priority of a job that is created. * How to Set Process Priorities With nice and renice on Linux, Topic: The nice Command.