{
    "mode": "man",
    "parameter": "FGCONSOLE",
    "section": "",
    "url": "https://www.chedong.com/phpMan.php/man/FGCONSOLE/json",
    "generated": "2026-10-22T13:07:38Z",
    "synopsis": "fgconsole [ -h --help | -V --version | -n --next-available ]",
    "sections": {
        "NAME": {
            "content": "fgconsole - print the number of the active VT.\n\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "fgconsole [ -h --help | -V --version | -n --next-available ]\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "If the active Virtual Terminal is /dev/ttyN, then prints N on standard output.\n\nIf the console is a serial console, then \"serial\" is printed instead.\n\n-h --help\nPrints short usage message and exits.\n\n-V --version\nPrints version number and exits.\n\n--next-available\nWill  show the next unallocated virtual terminal. Normally 6 virtual terminals are al‐\nlocated, with number 7 used for X; this will return \"8\" in this case.\n\n",
            "subsections": []
        },
        "NOTES": {
            "content": "Under devfs, the consoles are in /dev/vc/N.  devfsd may maintain symlinks for compatibility.\n",
            "subsections": []
        },
        "SEE ALSO": {
            "content": "chvt(1).\n\n\nkbd                                       14 February 2002                              FGCONSOLE(1)",
            "subsections": []
        }
    },
    "summary": "fgconsole - print the number of the active VT.",
    "flags": [],
    "examples": [],
    "see_also": [
        {
            "name": "chvt",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/chvt/1/json"
        }
    ],
    "tldr": {
        "source": "official",
        "description": "Print the number of the foreground virtual terminal.",
        "examples": [
            {
                "description": "Print current terminal number or `serial` if the terminal is serial",
                "command": "fgconsole"
            },
            {
                "description": "Print the next unallocated virtual terminal",
                "command": "fgconsole {{-n|--next-available}}"
            }
        ]
    }
}