What command followed by the flag -p allows setting the nice level of a process by its ID?

Disable ads (and more) with a premium pass for a one time $4.99 payment

Boost your Linux skills with the CompTIA Linux+ Certification Exam simulator. Engage with multiple choice questions and detailed feedback. Master Linux concepts and prepare for your exam with confidence!

The command that allows you to set the nice level of a process by its ID, when followed by the flag -p, is "renice." The primary function of the renice command is to change the priority of running processes, which is done by adjusting their nice value.

When using the -p flag with renice, you specify the process ID (PID) of the target process, allowing you to adjust its nice level without needing to stop or restart the process. This is particularly useful for system administrators who need to manage process priorities on a running system. For example, using "renice -n 10 -p 1234" would change the priority of the process with PID 1234 to a lower priority (indicating it will get less CPU time compared to other processes).

The other options concern commands that either do not exist in standard Linux distributions or serve different purposes. For instance, nice is used to launch a new process with a specified nice value rather than altering the priority of an existing process. Similarly, setnice and chnice do not exist as recognized commands in the standard Linux command repertoire for managing process priorities.

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy