LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

chvt

Switch the foreground virtual terminal

TLDR

Switch the console to TTY number N (requires root)
$ sudo chvt [N]
copy

SYNOPSIS

chvt N

DESCRIPTION

chvt changes the foreground virtual terminal to terminal N. Virtual terminals (VTs) are the text consoles accessible via Ctrl+Alt+F1 through F7 on most Linux systems.This is equivalent to pressing Ctrl+Alt+FN but can be done programmatically or when keyboard shortcuts are unavailable.

PARAMETERS

N

The virtual terminal number to switch to (typically 1-7)

INSTALL

sudo apt install kbd
copy
sudo dnf install kbd
copy
sudo pacman -S kbd
copy
sudo apk add kbd
copy
sudo zypper install kbd
copy
nix profile install nixpkgs#kbd
copy

CAVEATS

Requires root privileges. The target VT must exist. On systems with graphical desktop, VT7 or VT1 is typically the X/Wayland session. Available VTs depend on system configuration.

SEE ALSO

Copied to clipboard
Kai