Filters
Zo zoek je
  • Gewone woorden vinden namen, teksten en voorbeelden.
  • "twee woorden" vindt precies die zin.
  • --naam of -x vindt een optie.
  • #woord zoekt alleen in commando's.
  • @grep vindt lessen en labs die grep gebruiken.
  • Filters: cat:network · in:labs · in:notes · level:rhcsa · ch:8 · root:yes. Zet ! voor een woord om het weg te laten. OR tussen woorden betekent één ervan.
  • ↑ ↓ bewegen · Enter openen · Esc sluiten · / zoeken

chvt

Switch the screen of the machine to another virtual terminal (tty1 … tty12).

Niveau
Dagelijks Linux
Groep
Shell en hulp
Root nodig
Ja
Pakket
kbd

Dit deel is nog niet vertaald. Je ziet de Engelse tekst.

Wat het doet

chvt N makes /dev/ttyN the active console, like pressing Ctrl+Alt+FN. It is useful when you work on a machine through a remote tool that cannot send Ctrl+Alt key combinations, or from a script.

You must be root (or own the console) to switch.

Zo schrijf je het

chvt [OPTION] N

Opties 3

Meest gebruikt

N
The number of the virtual terminal (1 to 12, or more).
-h, --help
Show help.
-V, --version
Show the version.

Voorbeelden 10

$ als gewone gebruiker# als root (of met sudo)

  1. 1Go to the third text console

    chvt 3

    Same as Ctrl+Alt+F3.

  2. 2Go back to the graphical login screen

    chvt 1

    On RHEL with a desktop, tty1 is the login screen.

  3. 3Switch to your graphical session

    chvt 2

    On RHEL your desktop session usually runs on tty2.

  4. 4Use it over SSH to show a console to a colleague

    chvt 4

    The physical screen in the server room changes.

  5. 5See which terminal is active

    cat /sys/class/tty/tty0/active
    tty2

    Shows the active virtual terminal.

  6. 6Switch when the remote console cannot send Ctrl+Alt+F keys

    chvt 3

    Many web consoles of virtual machines catch these keys.

  7. 7Free a virtual terminal that is not used

    deallocvt 7

    Removes unused consoles from memory.

  8. 8Open a login on another console from a script

    openvt -c 5 -- /bin/login

    Starts a login program on tty5.

  9. 9Check which consoles have a login prompt

    systemctl list-units 'getty@*'

    Each text console with a login prompt is a getty service.

  10. 10Switch back after maintenance

    chvt 1

    Leave the screen at the login prompt.

Let op

  • chvt changes the physical screen. Users on the console notice it.

Tips om te onthouden

  • chvt N = Ctrl+Alt+FN from the command line.

Volledige handleiding

Deze pagina legt het commando uit in eenvoudige woorden. De originele handleiding heeft elk detail.

In je terminal: man chvt