In pkill, which option targets processes based on the owning user?

Prepare for the Red Hat Certified Systems Admin Exam EX200. Enhance your skills with interactive quizzes, flashcards, and detailed explanations. Ace your certification exam today!

Multiple Choice

In pkill, which option targets processes based on the owning user?

Explanation:
Targeting by the owning user is done with the -u option in pkill. This flag tells pkill to select only processes whose owner (the user account that started the process) matches the specified username or UID. It’s especially useful when you want to stop all processes started by a particular user without affecting others, regardless of what those processes are doing. For example, pkill -u alice will terminate all processes owned by alice. If you want to narrow further to a specific program, you can combine it with a pattern, such as pkill -u alice -f sshd, where -f makes the match apply to the full command line. The other options don’t focus on ownership: -f makes the command line participate in the match, -x matches the exact process name, and -U exists to match by the real user ID (a related but different attribute).

Targeting by the owning user is done with the -u option in pkill. This flag tells pkill to select only processes whose owner (the user account that started the process) matches the specified username or UID. It’s especially useful when you want to stop all processes started by a particular user without affecting others, regardless of what those processes are doing.

For example, pkill -u alice will terminate all processes owned by alice. If you want to narrow further to a specific program, you can combine it with a pattern, such as pkill -u alice -f sshd, where -f makes the match apply to the full command line.

The other options don’t focus on ownership: -f makes the command line participate in the match, -x matches the exact process name, and -U exists to match by the real user ID (a related but different attribute).

Subscribe

Get the latest from Passetra

You can unsubscribe at any time. Read our privacy policy