{
    "content": [
        {
            "type": "text",
            "text": "# LAST(1) (man)\n\n**Summary:** last, lastb - show a listing of last logged in users\n\n**Synopsis:** last [options] [username...] [tty...]\nlastb [options] [username...] [tty...]\n\n## Flags\n\n| Flag | Long | Arg | Description |\n|------|------|-----|-------------|\n| -a | --hostlast | — | Display the hostname in the last column. Useful in combination with the --dns option. |\n| -d | --dns | — | For non-local logins, Linux stores not only the host name of the remote host, but its IP number as well. This option tra |\n| -f | --file | — | Tell last to use a specific file instead of /var/log/wtmp. The --file option can be given multiple times, and all of the |\n| -F | --fulltimes | — | Print full login and logout times and dates. |\n| -i | --ip | — | Like --dns , but displays the host’s IP number instead of the name. -number; -n, --limit number Tell last how many lines |\n| -p | --present | — | Display the users who were present at the specified time. This is like using the options --since and --until together wi |\n| -R | --nohostname | — | Suppresses the display of the hostname field. |\n| -s | --since | — | Display the state of logins since the specified time. This is useful, e.g., to easily determine who was logged in at a p |\n| -t | --until | — | Display the state of logins until the specified time. --time-format format Define the output timestamp format to be one  |\n| -w | --fullnames | — | Display full user names and domain names in the output. |\n| -x | --system | — | Display the system shutdown entries and run level changes. |\n\n## See Also\n\n- login(1)\n- wtmp(5)\n- init(8)\n- shutdown(8)\n\n## Section Outline\n\n- **NAME** (2 lines)\n- **SYNOPSIS** (4 lines)\n- **DESCRIPTION** (15 lines)\n- **OPTIONS** (1 lines) — 11 subsections\n  - -a --hostlast (2 lines)\n  - -d --dns (3 lines)\n  - -f --file (3 lines)\n  - -F --fulltimes (2 lines)\n  - -i --ip (5 lines)\n  - -p --present (3 lines)\n  - -R --nohostname (2 lines)\n  - -s --since (4 lines)\n  - -t --until (9 lines)\n  - -w --fullnames (2 lines)\n  - -x --system (2 lines)\n- **TIME FORMATS** (41 lines)\n- **FILES** (2 lines)\n- **NOTES** (4 lines)\n- **AUTHORS** (2 lines)\n- **SEE ALSO** (2 lines)\n- **REPORTING BUGS** (2 lines)\n- **AVAILABILITY** (6 lines)\n\n## Full Content\n\n### NAME\n\nlast, lastb - show a listing of last logged in users\n\n### SYNOPSIS\n\nlast [options] [username...] [tty...]\n\nlastb [options] [username...] [tty...]\n\n### DESCRIPTION\n\nlast searches back through the /var/log/wtmp file (or the file designated by the -f option)\nand displays a list of all users logged in (and out) since that file was created. One or more\nusernames and/or ttys can be given, in which case last will show only the entries matching\nthose arguments. Names of ttys can be abbreviated, thus last 0 is the same as last tty0.\n\nWhen catching a SIGINT signal (generated by the interrupt key, usually control-C) or a\nSIGQUIT signal, last will show how far it has searched through the file; in the case of the\nSIGINT signal last will then terminate.\n\nThe pseudo user reboot logs in each time the system is rebooted. Thus last reboot will show a\nlog of all the reboots since the log file was created.\n\nlastb is the same as last, except that by default it shows a log of the /var/log/btmp file,\nwhich contains all the bad login attempts.\n\n### OPTIONS\n\n#### -a --hostlast\n\nDisplay the hostname in the last column. Useful in combination with the --dns option.\n\n#### -d --dns\n\nFor non-local logins, Linux stores not only the host name of the remote host, but its IP\nnumber as well. This option translates the IP number back into a hostname.\n\n#### -f --file\n\nTell last to use a specific file instead of /var/log/wtmp. The --file option can be given\nmultiple times, and all of the specified files will be processed.\n\n#### -F --fulltimes\n\nPrint full login and logout times and dates.\n\n#### -i --ip\n\nLike --dns , but displays the host’s IP number instead of the name.\n\n-number; -n, --limit number\nTell last how many lines to show.\n\n#### -p --present\n\nDisplay the users who were present at the specified time. This is like using the options\n--since and --until together with the same time.\n\n#### -R --nohostname\n\nSuppresses the display of the hostname field.\n\n#### -s --since\n\nDisplay the state of logins since the specified time. This is useful, e.g., to easily\ndetermine who was logged in at a particular time. The option is often combined with\n--until.\n\n#### -t --until\n\nDisplay the state of logins until the specified time.\n\n--time-format format\nDefine the output timestamp format to be one of notime, short, full, or iso. The notime\nvariant will not print any timestamps at all, short is the default, and full is the same\nas the --fulltimes option. The iso variant will display the timestamp in ISO-8601 format.\nThe ISO format contains timezone information, making it preferable when printouts are\ninvestigated outside of the system.\n\n#### -w --fullnames\n\nDisplay full user names and domain names in the output.\n\n#### -x --system\n\nDisplay the system shutdown entries and run level changes.\n\n### TIME FORMATS\n\nThe options that take the time argument understand the following formats:\n\n┌────────────────────┬────────────────────────────────┐\n│                    │                                │\n│YYYYMMDDhhmmss      │                                │\n├────────────────────┼────────────────────────────────┤\n│                    │                                │\n│YYYY-MM-DD hh:mm:ss │                                │\n├────────────────────┼────────────────────────────────┤\n│                    │                                │\n│YYYY-MM-DD hh:mm    │ (seconds will be set to 00)    │\n├────────────────────┼────────────────────────────────┤\n│                    │                                │\n│YYYY-MM-DD          │ (time will be set to 00:00:00) │\n├────────────────────┼────────────────────────────────┤\n│                    │                                │\n│hh:mm:ss            │ (date will be set to today)    │\n├────────────────────┼────────────────────────────────┤\n│                    │                                │\n│hh:mm               │ (date will be set to today,    │\n│                    │ seconds to 00)                 │\n├────────────────────┼────────────────────────────────┤\n│                    │                                │\n│now                 │                                │\n├────────────────────┼────────────────────────────────┤\n│                    │                                │\n│yesterday           │ (time is set to 00:00:00)      │\n├────────────────────┼────────────────────────────────┤\n│                    │                                │\n│today               │ (time is set to 00:00:00)      │\n├────────────────────┼────────────────────────────────┤\n│                    │                                │\n│tomorrow            │ (time is set to 00:00:00)      │\n├────────────────────┼────────────────────────────────┤\n│                    │                                │\n│+5min               │                                │\n├────────────────────┼────────────────────────────────┤\n│                    │                                │\n│-5days              │                                │\n└────────────────────┴────────────────────────────────┘\n\n### FILES\n\n/var/log/wtmp, /var/log/btmp\n\n### NOTES\n\nThe files wtmp and btmp might not be found. The system only logs information in these files\nif they are present. This is a local configuration issue. If you want the files to be used,\nthey can be created with a simple touch(1) command (for example, touch /var/log/wtmp).\n\n### AUTHORS\n\nMiquel van Smoorenburg <miquels@cistron.nl>\n\n### SEE ALSO\n\nlogin(1), wtmp(5), init(8), shutdown(8)\n\n### REPORTING BUGS\n\nFor bug reports, use the issue tracker at https://github.com/karelzak/util-linux/issues.\n\n### AVAILABILITY\n\nThe last command is part of the util-linux package which can be downloaded from Linux Kernel\nArchive <https://www.kernel.org/pub/linux/utils/util-linux/>.\n\n\n\nutil-linux 2.37.2                            2021-06-02                                      LAST(1)\n\n"
        }
    ],
    "structuredContent": {
        "command": "LAST",
        "section": "1",
        "mode": "man",
        "summary": "last, lastb - show a listing of last logged in users",
        "synopsis": "last [options] [username...] [tty...]\nlastb [options] [username...] [tty...]",
        "tldr_summary": null,
        "tldr_examples": [],
        "tldr_source": null,
        "flags": [
            {
                "flag": "-a",
                "long": "--hostlast",
                "arg": null,
                "description": "Display the hostname in the last column. Useful in combination with the --dns option."
            },
            {
                "flag": "-d",
                "long": "--dns",
                "arg": null,
                "description": "For non-local logins, Linux stores not only the host name of the remote host, but its IP number as well. This option translates the IP number back into a hostname."
            },
            {
                "flag": "-f",
                "long": "--file",
                "arg": null,
                "description": "Tell last to use a specific file instead of /var/log/wtmp. The --file option can be given multiple times, and all of the specified files will be processed."
            },
            {
                "flag": "-F",
                "long": "--fulltimes",
                "arg": null,
                "description": "Print full login and logout times and dates."
            },
            {
                "flag": "-i",
                "long": "--ip",
                "arg": null,
                "description": "Like --dns , but displays the host’s IP number instead of the name. -number; -n, --limit number Tell last how many lines to show."
            },
            {
                "flag": "-p",
                "long": "--present",
                "arg": null,
                "description": "Display the users who were present at the specified time. This is like using the options --since and --until together with the same time."
            },
            {
                "flag": "-R",
                "long": "--nohostname",
                "arg": null,
                "description": "Suppresses the display of the hostname field."
            },
            {
                "flag": "-s",
                "long": "--since",
                "arg": null,
                "description": "Display the state of logins since the specified time. This is useful, e.g., to easily determine who was logged in at a particular time. The option is often combined with --until."
            },
            {
                "flag": "-t",
                "long": "--until",
                "arg": null,
                "description": "Display the state of logins until the specified time. --time-format format Define the output timestamp format to be one of notime, short, full, or iso. The notime variant will not print any timestamps at all, short is the default, and full is the same as the --fulltimes option. The iso variant will display the timestamp in ISO-8601 format. The ISO format contains timezone information, making it preferable when printouts are investigated outside of the system."
            },
            {
                "flag": "-w",
                "long": "--fullnames",
                "arg": null,
                "description": "Display full user names and domain names in the output."
            },
            {
                "flag": "-x",
                "long": "--system",
                "arg": null,
                "description": "Display the system shutdown entries and run level changes."
            }
        ],
        "examples": [],
        "see_also": [
            {
                "name": "login",
                "section": "1",
                "url": "https://www.chedong.com/phpMan.php/man/login/1/json"
            },
            {
                "name": "wtmp",
                "section": "5",
                "url": "https://www.chedong.com/phpMan.php/man/wtmp/5/json"
            },
            {
                "name": "init",
                "section": "8",
                "url": "https://www.chedong.com/phpMan.php/man/init/8/json"
            },
            {
                "name": "shutdown",
                "section": "8",
                "url": "https://www.chedong.com/phpMan.php/man/shutdown/8/json"
            }
        ],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 4,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 15,
                "subsections": []
            },
            {
                "name": "OPTIONS",
                "lines": 1,
                "subsections": [
                    {
                        "name": "-a --hostlast",
                        "lines": 2,
                        "flag": "-a",
                        "long": "--hostlast"
                    },
                    {
                        "name": "-d --dns",
                        "lines": 3,
                        "flag": "-d",
                        "long": "--dns"
                    },
                    {
                        "name": "-f --file",
                        "lines": 3,
                        "flag": "-f",
                        "long": "--file"
                    },
                    {
                        "name": "-F --fulltimes",
                        "lines": 2,
                        "flag": "-F",
                        "long": "--fulltimes"
                    },
                    {
                        "name": "-i --ip",
                        "lines": 5,
                        "flag": "-i",
                        "long": "--ip"
                    },
                    {
                        "name": "-p --present",
                        "lines": 3,
                        "flag": "-p",
                        "long": "--present"
                    },
                    {
                        "name": "-R --nohostname",
                        "lines": 2,
                        "flag": "-R",
                        "long": "--nohostname"
                    },
                    {
                        "name": "-s --since",
                        "lines": 4,
                        "flag": "-s",
                        "long": "--since"
                    },
                    {
                        "name": "-t --until",
                        "lines": 9,
                        "flag": "-t",
                        "long": "--until"
                    },
                    {
                        "name": "-w --fullnames",
                        "lines": 2,
                        "flag": "-w",
                        "long": "--fullnames"
                    },
                    {
                        "name": "-x --system",
                        "lines": 2,
                        "flag": "-x",
                        "long": "--system"
                    }
                ]
            },
            {
                "name": "TIME FORMATS",
                "lines": 41,
                "subsections": []
            },
            {
                "name": "FILES",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "NOTES",
                "lines": 4,
                "subsections": []
            },
            {
                "name": "AUTHORS",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SEE ALSO",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "REPORTING BUGS",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "AVAILABILITY",
                "lines": 6,
                "subsections": []
            }
        ]
    }
}