Linux Basic Practice Multiple Choice Questions – 10

46. Question: You notice that a process in the Linux system is consuming too much CPU resources. Which command would you use to adjust its priority?

Option 1: nice

Option 2: renice

Option 3: top

Option 4: ps

Correct Answer: 2

Explanation: To adjust the priority of a running process in Linux, you would use the renice command. This command allows you to change the nice value of a process, thereby adjusting its CPU priority. The lower the nice value, the higher the priority.

47. Question: You are debugging an application and need to trace the system calls it makes. Which tool would you use in Linux?

Option 1: strace

Option 2: ltrace

Option 3: gdb

Option 4: valgrind

Correct Answer: 1

Explanation: To trace the system calls made by an application in Linux, you would use the strace tool. It provides detailed information about the system calls, signals, and other interactions between the application and the operating system, which is invaluable for debugging and analysis.

48. Question: A user reports that their application occasionally freezes. You suspect this is due to the application waiting for certain I/O operations to complete. During these freezes, what state might the process be in?

Option 1: D (Uninterruptible Sleep)

Option 2: R (Running)

Option 3: S (Sleeping)

Option 4: Z (Zombie)

Correct Answer: 1

Explanation: During I/O operations, a process may enter the “D” state, which indicates uninterruptible sleep. This state signifies that the process is waiting for resources to become available and cannot be interrupted. It is often associated with delays or issues related to I/O.

49. Question: What is the command used to add a new user in Linux?

Option 1: useradd

Option 2: adduser

Option 3: newuser

Option 4: createuser

Correct Answer: 1

Explanation: The correct command to add a new user in Linux is useradd. This command creates a new user account and its associated files. It is used to specify user details such as home directory and shell.

50. Question: What is the primary package management tool used in Debian and its derivatives?

Option 1: APT

Option 2: YUM

Option 3: DNF

Option 4: Zypper

Correct Answer: 1

Explanation: The primary package management tool used in Debian and its derivatives is APT (Advanced Package Tool). APT is a package management system that allows users to install, upgrade, and remove software packages on Debian-based systems.

Leave a Comment