{
    "mode": "pydoc",
    "parameter": "pwd",
    "section": "",
    "url": "https://www.chedong.com/phpMan.php/pydoc/pwd/json",
    "generated": "2026-06-02T15:53:04Z",
    "sections": {
        "NAME": {
            "content": "pwd\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "This module provides access to the Unix password database.\nIt is available on all Unix versions.\n\nPassword database entries are reported as 7-tuples containing the following\nitems from the password database (see `<pwd.h>'), in order:\npwname, pwpasswd, pwuid, pwgid, pwgecos, pwdir, pwshell.\nThe uid and gid items are integers, all others are strings. An\nexception is raised if the entry asked for cannot be found.\n",
            "subsections": []
        },
        "CLASSES": {
            "content": "builtins.tuple(builtins.object)\nstructpasswd\n",
            "subsections": [
                {
                    "name": "class struct_passwd",
                    "content": "|  structpasswd(iterable=(), /)\n|\n|  pwd.structpasswd: Results from getpw*() routines.\n|\n|  This object may be accessed either as a tuple of\n|    (pwname,pwpasswd,pwuid,pwgid,pwgecos,pwdir,pwshell)\n|  or via the object attributes as named in the above tuple.\n|\n|  Method resolution order:\n|      structpasswd\n|      builtins.tuple\n|      builtins.object\n|\n|  Methods defined here:\n|\n|  reduce(...)\n|      Helper for pickle.\n|\n|  repr(self, /)\n|      Return repr(self).\n|\n|  ----------------------------------------------------------------------\n|  Static methods defined here:\n|\n|  new(*args, kwargs) from builtins.type\n|      Create and return a new object.  See help(type) for accurate signature.\n|\n|  ----------------------------------------------------------------------\n|  Data descriptors defined here:\n|\n|  pwdir\n|      home directory\n|\n|  pwgecos\n|      real name\n|\n|  pwgid\n|      group id\n|\n|  pwname\n|      user name\n|\n|  pwpasswd\n|      password\n|\n|  pwshell\n|      shell program\n|\n|  pwuid\n|      user id\n|\n|  ----------------------------------------------------------------------\n|  Data and other attributes defined here:\n|\n|  matchargs = ('pwname', 'pwpasswd', 'pwuid', 'pwgid', 'pwgeco...\n|\n|  nfields = 7\n|\n|  nsequencefields = 7\n|\n|  nunnamedfields = 0\n|\n|  ----------------------------------------------------------------------\n|  Methods inherited from builtins.tuple:\n|\n|  add(self, value, /)\n|      Return self+value.\n|\n|  contains(self, key, /)\n|      Return key in self.\n|\n|  eq(self, value, /)\n|      Return self==value.\n|\n|  ge(self, value, /)\n|      Return self>=value.\n|\n|  getattribute(self, name, /)\n|      Return getattr(self, name).\n|\n|  getitem(self, key, /)\n|      Return self[key].\n|\n|  getnewargs(self, /)\n|\n|  gt(self, value, /)\n|      Return self>value.\n|\n|  hash(self, /)\n|      Return hash(self).\n|\n|  iter(self, /)\n|      Implement iter(self).\n|\n|  le(self, value, /)\n|      Return self<=value.\n|\n|  len(self, /)\n|      Return len(self).\n|\n|  lt(self, value, /)\n|      Return self<value.\n|\n|  mul(self, value, /)\n|      Return self*value.\n|\n|  ne(self, value, /)\n|      Return self!=value.\n|\n|  rmul(self, value, /)\n|      Return value*self.\n|\n|  count(self, value, /)\n|      Return number of occurrences of value.\n|\n|  index(self, value, start=0, stop=9223372036854775807, /)\n|      Return first index of value.\n|\n|      Raises ValueError if the value is not present.\n|\n|  ----------------------------------------------------------------------\n|  Class methods inherited from builtins.tuple:\n|\n|  classgetitem(...) from builtins.type\n|      See PEP 585\n"
                }
            ]
        },
        "FUNCTIONS": {
            "content": "",
            "subsections": [
                {
                    "name": "getpwall",
                    "content": "Return a list of all available password database entries, in arbitrary order.\n\nSee help(pwd) for more on password database entries.\n"
                },
                {
                    "name": "getpwnam",
                    "content": "Return the password database entry for the given user name.\n\nSee `help(pwd)` for more on password database entries.\n"
                },
                {
                    "name": "getpwuid",
                    "content": "Return the password database entry for the given numeric user ID.\n\nSee `help(pwd)` for more on password database entries.\n"
                }
            ]
        },
        "FILE": {
            "content": "(built-in)\n\n",
            "subsections": []
        }
    },
    "summary": "pwd",
    "flags": [],
    "examples": [],
    "see_also": [],
    "tldr": {
        "source": "official",
        "description": "Print the name of current/working directory.",
        "examples": [
            {
                "description": "Print the current directory",
                "command": "pwd"
            },
            {
                "description": "Print the current directory, and resolve all symlinks (i.e. show the \"physical\" path)",
                "command": "pwd {{-P|--physical}}"
            },
            {
                "description": "Display help",
                "command": "pwd --help"
            }
        ]
    }
}