LinuxCommandLibrary

fgconsole

print foreground virtual terminal number

TLDR

Print current terminal number

$ fgconsole
copy
Print next unallocated virtual terminal
$ fgconsole [-n|--next-available]
copy

SYNOPSIS

fgconsole [options]

DESCRIPTION

fgconsole prints the number of the foreground virtual terminal. If the terminal is serial, it prints "serial" instead of a number.
Part of kbd package for console management utilities.

PARAMETERS

-n, --next-available

Print next unallocated VT number

CAVEATS

Only works on Linux console. Returns error if not on a virtual terminal. Part of kbd package.

SEE ALSO

chvt(1), openvt(1), deallocvt(1)

> TERMINAL_GEAR

Curated for the Linux community

Copied to clipboard

> TERMINAL_GEAR

Curated for the Linux community