{
    "content": [
        {
            "type": "text",
            "text": "# lastlog (info)\n\n## NAME\n\nlastlog - reports the most recent login of all users or of a given user\n\n## SYNOPSIS\n\nlastlog [options]\n\n## DESCRIPTION\n\nlastlog formats and prints the contents of the last login log\n/var/log/lastlog file. The login-name, port, and last login time will\nbe printed. The default (no flags) causes lastlog entries to be\nprinted, sorted by their order in /etc/passwd.\n\n## Sections\n\n- **NAME**\n- **SYNOPSIS**\n- **DESCRIPTION**\n- **OPTIONS** (3 subsections)\n- **NOTE**\n- **CONFIGURATION**\n- **FILES**\n- **CAVEATS**\n\nUse structuredContent.sections for detailed options, examples, and full documentation.\n"
        }
    ],
    "structuredContent": {
        "command": "lastlog",
        "section": "",
        "mode": "info",
        "summary": "lastlog - reports the most recent login of all users or of a given user",
        "synopsis": "lastlog [options]",
        "tldr_summary": null,
        "tldr_examples": [],
        "tldr_source": null,
        "flags": [
            {
                "flag": "-C",
                "long": "--clear",
                "arg": null,
                "description": "Clear lastlog record of a user. This option can be used only together with -u (--user))."
            },
            {
                "flag": "-h",
                "long": "--help",
                "arg": null,
                "description": "Display help message and exit. -R, --root CHROOTDIR Apply changes in the CHROOTDIR directory and use the configuration files from the CHROOTDIR directory."
            },
            {
                "flag": "-S",
                "long": "--set",
                "arg": null,
                "description": "Set lastlog record of a user to the current time. This option can be used only together with -u (--user)). -t, --time DAYS Print the lastlog records more recent than DAYS. -u, --user LOGIN|RANGE Print the lastlog record of the specified user(s). The users can be specified by a login name, a numerical user ID, or a RANGE of users. This RANGE of users can be specified with a min and max values (UIDMIN-UIDMAX), a max value (-UIDMAX), or a min value (UIDMIN-). If the user has never logged in the message Never logged in will be displayed instead of the port and time. Only the entries for the current users of the system will be displayed. Other entries may exist for users that were deleted previously."
            }
        ],
        "examples": [],
        "see_also": [],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 5,
                "subsections": []
            },
            {
                "name": "OPTIONS",
                "lines": 5,
                "subsections": [
                    {
                        "name": "-C, --clear",
                        "lines": 3,
                        "flag": "-C",
                        "long": "--clear"
                    },
                    {
                        "name": "-h, --help",
                        "lines": 6,
                        "flag": "-h",
                        "long": "--help"
                    },
                    {
                        "name": "-S, --set",
                        "lines": 20,
                        "flag": "-S",
                        "long": "--set"
                    }
                ]
            },
            {
                "name": "NOTE",
                "lines": 6,
                "subsections": []
            },
            {
                "name": "CONFIGURATION",
                "lines": 12,
                "subsections": []
            },
            {
                "name": "FILES",
                "lines": 3,
                "subsections": []
            },
            {
                "name": "CAVEATS",
                "lines": 6,
                "subsections": []
            }
        ],
        "sections": {
            "NAME": {
                "content": "lastlog - reports the most recent login of all users or of a given user\n",
                "subsections": []
            },
            "SYNOPSIS": {
                "content": "lastlog [options]\n",
                "subsections": []
            },
            "DESCRIPTION": {
                "content": "lastlog formats and prints the contents of the last login log\n/var/log/lastlog file. The login-name, port, and last login time will\nbe printed. The default (no flags) causes lastlog entries to be\nprinted, sorted by their order in /etc/passwd.\n",
                "subsections": []
            },
            "OPTIONS": {
                "content": "The options which apply to the lastlog command are:\n\n-b, --before DAYS\nPrint only lastlog records older than DAYS.\n",
                "subsections": [
                    {
                        "name": "-C, --clear",
                        "content": "Clear lastlog record of a user. This option can be used only\ntogether with -u (--user)).\n",
                        "flag": "-C",
                        "long": "--clear"
                    },
                    {
                        "name": "-h, --help",
                        "content": "Display help message and exit.\n\n-R, --root CHROOTDIR\nApply changes in the CHROOTDIR directory and use the configuration\nfiles from the CHROOTDIR directory.\n",
                        "flag": "-h",
                        "long": "--help"
                    },
                    {
                        "name": "-S, --set",
                        "content": "Set lastlog record of a user to the current time. This option can\nbe used only together with -u (--user)).\n\n-t, --time DAYS\nPrint the lastlog records more recent than DAYS.\n\n-u, --user LOGIN|RANGE\nPrint the lastlog record of the specified user(s).\n\nThe users can be specified by a login name, a numerical user ID, or\na RANGE of users. This RANGE of users can be specified with a min\nand max values (UIDMIN-UIDMAX), a max value (-UIDMAX), or a min\nvalue (UIDMIN-).\n\nIf the user has never logged in the message  Never logged in will\nbe displayed instead of the port and time.\n\nOnly the entries for the current users of the system will be displayed.\nOther entries may exist for users that were deleted previously.\n",
                        "flag": "-S",
                        "long": "--set"
                    }
                ]
            },
            "NOTE": {
                "content": "The lastlog file is a database which contains info on the last login of\neach user. You should not rotate it. It is a sparse file, so its size\non the disk is usually much smaller than the one shown by \"ls -l\"\n(which can indicate a really big file if you have in passwd users with\na high UID). You can display its real size with \"ls -s\".\n",
                "subsections": []
            },
            "CONFIGURATION": {
                "content": "The following configuration variables in /etc/login.defs change the\nbehavior of this tool:\n\nLASTLOGUIDMAX (number)\nHighest user ID number for which the lastlog entries should be\nupdated. As higher user IDs are usually tracked by remote user\nidentity and authentication services there is no need to create a\nhuge sparse lastlog file for them.\n\nNo LASTLOGUIDMAX option present in the configuration means that\nthere is no user ID limit for writing lastlog entries.\n",
                "subsections": []
            },
            "FILES": {
                "content": "/var/log/lastlog\nDatabase times of previous user logins.\n",
                "subsections": []
            },
            "CAVEATS": {
                "content": "Large gaps in UID numbers will cause the lastlog program to run longer\nwith no output to the screen (i.e. if in lastlog database there is no\nentries for users with UID between 170 and 800 lastlog will appear to\nhang as it processes entries with UIDs 171-799).\n\nshadow-utils 4.8.1                02/06/2024                        LASTLOG(8)",
                "subsections": []
            }
        }
    }
}