"chvt N" lets me switch to foreground terminal N, the same as pushing alt-ctrl-FN.

What command line program tells me what terminal I'm currently using?


fgconsole prints the number of the active VT.

| improve this answer | |

This command tells you what terminal you are using:


This command tells you what virtual terminal is currently active:

head -n 1 /sys/devices/virtual/tty/tty0/active

The two are not necessarily equivalent. There are other sorts of terminals than virtual terminals, after all.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy