When piping the output of find to the xargs command, what option to find is useful if the filenames have spaces in them?
Correct Answer: A
Question 12
Which of the following commands kills the process with the PID 123 but allows the process to "clean up" before exiting?
Correct Answer: D
Question 13
Which of the following commands moves and resumes in the background the last stopped shell job?
Correct Answer: B
Explanation The bg command is used to move and resume in the background the last stopped shell job. A stopped job is a process that has been suspended by using Ctrl+Z or the kill -STOP command. The bg command will resume the execution of the stopped job and allow it to run in the background, without blocking the current shell. The bg command can also take a job number as an argument, which can be obtained by using the jobs command. For example, if the last stopped job is 1+ Stopped sleep 500, then the following command will move and resume it in the background: bg %1 The output will be: 1+ sleep 500 & The fg command is used to move and resume in the foreground the last stopped or backgrounded job. The run and back commands are not valid commands in Linux. References: * [LPI Exam 101 Detailed Objectives], Topic 103: GNU and Unix Commands, Objective 103.5: Create, monitor and kill processes, Weight: 4, Key Knowledge Areas: Use of jobs, fg and bg commands. * Linux Commands: jobs, bg, and fg, Topic: The bg Command.
Question 14
Which of the following commands installs all packages with a name ending with the string foo?
Correct Answer: D
Explanation The command that installs all packages with a name ending with the string foo is zypper install "*foo". The zypper command is the command line interface of the ZYpp package manager for SUSE Linux. The install (in) subcommand is used to install packages with specified capabilities or RPM files with specified location. The argument "*foo" is a glob pattern that matches any package name that ends with foo. For example, zypper install "foo" will install packages like barfoo, bazfoo, and foo itself. The other commands are either invalid or do not perform the desired task. The zypper get, zypper update, zypper force, and zypper add subcommands do not exist. The "foo?" and "foo" arguments are also invalid glob patterns, as they do not match the end of the package name. The ".*foo" argument is a valid glob pattern, but it matches any package name that contains foo, not just the ones that end with foo. References: * Zypper package manager - SUSE Documentation1 * zypper(8) [suse man page] - The UNIX and Linux Forums2 * 45 Zypper Commands to Manage 'Suse' Linux Package Management - Tecmint
Question 15
Which SysV init configuration file is commonly used to set the default run level? (Specify the full name of the file, including path.)
Correct Answer:
/etc/inittab Explanation The /etc/inittab file is a plain text file that contains information about the initialization process of the system. It defines the default run level, the available run levels, and the actions to be taken when entering or leaving a run level. The default run level is the mode of operation that the system starts up into, and it determines which services and processes are running. The default run level 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 run level, which can range from 0 to 6. The meaning of each run level is: * 0 - Halt * 1 - Single-user text mode * 2 - Not used (user-definable) * 3 - Full multi-user text mode * 4 - Not used (user-definable) * 5 - Full multi-user graphical mode (with an X-based login screen) * 6 - Reboot To change the default run level, edit the /etc/inittab file as root and change the number to the desired run level. For example, to change the default run level 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: * SysV Init Runlevels - Red Hat Customer Portal * F.4. SysV Init Runlevels - Red Hat Customer Portal * init - How can I see or change default run level? - Ask Ubuntu