Get Active Linux Virtual Console: Difference between revisions

From Leo's Notes
This page was last edited on 1 September 2019, at 06:20.
m Leo moved page Active Terminal to Get Active Linux Virtual Console: renaming to something more meaningful
m Text replacement - "Category:Linux{{Navbox Linux}}" to "{{Navbox Linux}}Category:Linux"
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
To get the active virtual terminal/console in use under Linux, use the {{code|fgconsole}} command, or run
To get the active virtual terminal/console in use under Linux, use the {{code|fgconsole}} command, or run


{{Highlight|lang=bash|code=
{{highlight|lang=terminal|code=
cat /sys/class/tty/tty0/active
cat /sys/class/tty/tty0/active
}}
}}
Line 7: Line 7:
{{Info|{{code|fgconsole}} requires root|The fgconsole requires root access or the ability to read {{code|/dev/tty0}} as the person running the program.}}
{{Info|{{code|fgconsole}} requires root|The fgconsole requires root access or the ability to read {{code|/dev/tty0}} as the person running the program.}}


[[Category:Linux]]
{{Navbox Linux}}[[Category:Linux]]

Latest revision as of 06:20, 1 September 2019

To get the active virtual terminal/console in use under Linux, use the fgconsole command, or run

cat /sys/class/tty/tty0/active
fgconsole requires root
The fgconsole requires root access or the ability to read /dev/tty0 as the person running the program.