Which command is used to check the types of user accounts on a Linux system?

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 is used to check the types of user accounts on a Linux system is getent. This command retrieves entries from various databases configured in the system's Name Service Switch (NSS) configuration. The types of databases that can be accessed include user accounts, group information, services, and more, depending on what is defined in the system’s /etc/nsswitch.conf file.

When you use getent passwd, it will display a list of user accounts as recorded in the system, allowing you to see both local and remote accounts (if configured) along with their respective attributes. This is particularly useful for understanding the various types of users present, such as normal users, system users, and service accounts.

The other commands, while related to user management, do not serve the purpose of checking account types:

  • useradd is used to create new user accounts.
  • users simply lists the currently logged-in users.
  • userdel is intended for deleting user accounts.

Thus, getent is the correct choice for verifying and obtaining detailed information about the types of user accounts on a Linux system.

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy