RHEL Linux - Red Hat System Administration Practice Exam

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

Study for the RHEL Linux - Red Hat System Administration Exam. Enhance your knowledge with flashcards and multiple-choice questions, complete with hints and explanations. Prepare for your certification!

Practice this question and more.


What does the command 'sudo -l' do?

  1. Lists all the files in the current directory

  2. Shows the commands the user can run with sudo

  3. Logs the user out of the system

  4. Changes the user's password

The correct answer is: Shows the commands the user can run with sudo

The command 'sudo -l' is used to display a list of commands that the current user is allowed to run with superuser privileges through the 'sudo' command. This capability is essential for understanding the permissions and privileges assigned to a specific user regarding administrative tasks on a Linux system. When executed, 'sudo -l' checks the user's rights in the sudoers configuration file and returns the relevant entries that specify which commands can be executed. This feature is particularly useful for users who want to confirm their level of access before attempting to run commands that require elevated privileges. It aids in security practices by ensuring users are aware of their capabilities and helps prevent unnecessary or unauthorized attempts to execute privileged commands. Consequently, the other options do not accurately reflect the function of the 'sudo -l' command. For example, listing files in a directory pertains to file management tasks, while logging out and changing a password are user session management tasks that do not involve 'sudo' privileges directly.