Skip to content

Linux getent Guide

Mattscreative edited this page Dec 5, 2025 · 2 revisions

Linux getent Guide

Complete beginner-friendly guide to getent on Linux, covering Arch Linux, CachyOS, and other distributions including database lookups, user information, and system database queries.


Table of Contents

  1. getent Basics
  2. User Database
  3. Group Database
  4. Host Database
  5. Troubleshooting

getent Basics

Query Database

Basic usage:

# Query passwd database
getent passwd username

# Shows user information

All Entries

All users:

# All users
getent passwd

# Shows all user entries

User Database

User Information

User lookup:

# User information
getent passwd username

# Shows:
# - Username
# - Password (x)
# - UID
# - GID
# - GECOS
# - Home directory
# - Shell

User ID

By UID:

# By UID
getent passwd 1000

# Finds user by UID

‍‍‍ Group Database

Group Information

Group lookup:

# Group information
getent group groupname

# Shows group details

Group Members

Group members:

# Group members
getent group users

# Shows group members

Host Database

Host Lookup

Host information:

# Host lookup
getent hosts hostname

# Shows host IP address

Services

Service lookup:

# Service lookup
getent services http

# Shows service information

Troubleshooting

getent Not Found

Check installation:

# getent is part of glibc
# Usually pre-installed

# Check getent
which getent

Summary

This guide covered getent usage, database lookups, and system database queries for Arch Linux, CachyOS, and other distributions.


Next Steps


This guide covers Arch Linux, CachyOS, and other Linux distributions. For distribution-specific details, refer to your distribution's documentation.

Clone this wiki locally