chvt
Switch virtual terminal (console)
TLDR
Change to a specific TTY
SYNOPSIS
chvt [OPTION]... [N]
PARAMETERS
N
VT number to switch to (1-63; default: next VT)
-h, --help
display this help and exit
-V, --version
output version information and exit
DESCRIPTION
chvt is a Linux utility for changing the active virtual terminal (VT), enabling quick switches between console sessions without keyboard shortcuts. Virtual terminals provide multiple text-based interfaces on a single physical display, typically accessed via Ctrl+Alt+F1 to F12.
Run as root, chvt N activates the Nth VT (e.g., chvt 3 for VT3). Without N, it cycles to the next VT. This proves invaluable for sysadmins debugging services, multi-user systems, or recovery from hung graphical logins by switching to a clean console.
The command interacts with the kernel's VT subsystem via ioctl calls, requiring CAP_SYS_TTY_CONFIG capability. It belongs to the util-linux package and works only on text consoles; graphical environments like X11 or Wayland ignore it unless executed from a VT. Modern systems with systemd use it alongside logind for session management.
CAVEATS
Requires root or CAP_SYS_TTY_CONFIG; ineffective in graphical sessions; VT count limited by kernel config (usually 63).
EXAMPLES
chvt 1
Switch to first VT.
chvt
Switch to next VT.
HISTORY
Introduced in util-linux around 1993 with Linux 0.99 VT support; maintained in util-linux suite, with updates for modern kernels and systemd integration.


