IMPORTANT: To view this page as Markdown, append `.md` to the URL (e.g. /docs/manual/basics.md). For the complete Mojo documentation index, see llms.txt.
Skip to main content
Version: Nightly
For the complete Mojo documentation index, see llms.txt. Markdown versions of all pages are available by appending .md to any URL (e.g. /docs/manual/basics.md).

pwd

Provides access to the user password database on Unix-like systems.

This module retrieves user account information from the system password database, similar to Python's pwd module. It provides functions to look up user entries by user ID or username, returning structured account information including home directory, shell, and user/group IDs.

Constraints: Available on Linux and macOS only.

Structs

  • Passwd: Represents user account information retrieved from the user password database related to a user ID.

Functions

  • getpwnam: Retrieves the user ID in the password database for the given user name.
  • getpwuid: Retrieve the password database entry for a given user ID.