Get Active Linux Virtual Console: Difference between revisions

From Leo's Notes
This page was last edited on 28 September 2015, at 21:02.
Created page with "To get the active virtual terminal in use under Linux, use the {{code|fgconsole}} command, or run {{Highlight|lang=bash|code= cat /sys/class/tty/tty0/active }} Category:Li..."
 
No edit summary
Line 1: Line 1:
To get the active virtual terminal 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=bash|code=
cat /sys/class/tty/tty0/active
cat /sys/class/tty/tty0/active
}}
}}
{{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]]
[[Category:Linux]]

Revision as of 21:02, 28 September 2015

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.