getent

A command that looks up entries in the system databases, such as users and groups, the way programs do.

In more detail

getent follows the name service configuration, so it shows local accounts and those from a directory service alike. It is the reliable way to check that an account or group exists.

Example

getent group devs prints devs:x:3000:mira,chen.

Related terms

Taught in

References

Certification courses