When starting a program with the nice command without any additional parameters, which nice level is set for the resulting process?
Correct Answer: C
Explanation When starting a program with the nice command without any additional parameters, the nice level is set to 10 for the resulting process. This means that the process will have a lower priority than the default value of 0, and will be more willing to yield CPU time to other processes. The nice command can also take 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. 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.
Question 27
Which of the following commands redirects the output of lsto standard error? ls >-1
Correct Answer: E
Question 28
In compliance with the FHS, in which of the following directories are documentation files found?
Correct Answer: D
Explanation 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: * LPI 101-500 Exam Objectives, Topic 101.3, Weight 2 * LPI Learning Materials, Chapter 1.3, Finding Linux Documentation * Web Search Results, 1
Question 29
In the vi editor, what vi command will copy (but not paste) from the current line at the cursor and the following 16 lines (17 lines total)? Specify the correct vi command without spaces.
Correct Answer:
17yy
Question 30
Which of the following files exist in a standard GRUB 2 installation? (Choose two.)
Correct Answer: B,D
Explanation The files that exist in a standard GRUB 2 installation are /boot/grub/i386-pc/1vm.mod and /boot/grub/grub.cfg. The /boot/grub/i386-pc/1vm.mod file is a GRUB 2 module that provides support forthe 1vm command, which allows loading a virtual machine image from a disk1. The /boot/grub/grub.cfg file is the main configuration file for GRUB 2, which contains the menu entries and options for the bootloader2. The other files are either non-existent or do not belong to GRUB 2. The /boot/grub/stages/stage0 file ispart of the GRUB legacy bootloader, which used a different architecture and naming scheme than GRUB 23. The /boot/grub/fstab file is not a valid file name, as fstab is the name of the file system table file that isusually located in /etc directory4. The /boot/grub/linux/vmlinuz file is also not a valid file name, as vmlinuz is the name of the compressed Linux kernel image that is usually located in /boot directory5. References: * GRUB 2 bootloader - Full tutorial - Dedoimedo1 * Grub2/Installing - Community Help Wiki - Official Ubuntu Documentation2 * GRUB bootloader - Full tutorial - Dedoimedo3 * fstab(5) - Linux manual page4 * vmlinuz(5) - Linux manual page5