CONSOLETYPE(1)
π CONSOLETYPE(1) β the iconic console-detective of a manual page
okay bestie, so this is consoletype from the General Commands Manual section of your local manpages, and honestly? she's lowkey a legend. Red Hat coded her, she's been serving since forever, and she tells you exactly what kind of console is plugged into your standard input. no cap. π
β¨ NAME β¨
consoletype β print type of the console connected to standard input
πΈ SYNOPSIS πΈ
she's a simple girl! two optional args, that's it. π
π¦ DESCRIPTION π¦
so here's the tea, bestie: consoletype prints the type of console connected to standard input, and it also checks whether the console connected to standard input is the current foreground virtual console. she does both, she's multitasking, she's that girl. π
With no arguments, she prints:
vtβ if the console is a virtual terminal (/dev/tty*or/dev/consoledevice if not on a serial console)serial</cΠΈΠ°Π½> β if standard input is a serial console (/dev/consoleor/dev/ttyS*)ptyβ if standard input is a pseudo terminal
like she's literally vibe-checking your terminal and reporting back. the way that she just knows?? πβ¨
π₯ RETURN VALUE π₯
okay so this is the part where she gets a lil spicy and the exit codes start meaning different things depending on what you asked her. pay attention bestie, this matters.
π«Ά when passed no arguments, consoletype returns
0β if on virtual terminal1β if on serial console2β if on a pseudo terminal.
π when passed the stdout argument, consoletype returns
0β in all cases, and prints the console type to stdout.
not her being consistent for once, we love a stable queen π
π when passed the fg argument, consoletype returns
0β if the console connected to standard input is the current virtual terminal1β otherwise.
and that's the whole page, babe. every flag, every code, every path β nothing skipped, nothing summarised, we keep it thorough around here. β¨
this lil masterpiece came from RH, brought to you by Red Hat, Inc, and she's filed under CONSOLETYPE(1). go forth and console-type, bestie β iykyk. π¦ππ
π¦ where this page comes from
- centos-stream 10: initscripts 10.26-2.el10 Β· GPL-2.0-only
- centos-stream 9: initscripts 10.11.9-2.el9 Β· GPLv2
- fedora 43: initscripts 10.26-4.fc43 Β· GPL-2.0-only
- fedora 43: initscripts 10.27-1.fc43 Β· GPL-2.0-only
- fedora 44: initscripts 10.27-2.fc44 Β· GPL-2.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms