.TH CONSOLETYPE 1 "Red Hat, Inc" "RH" \" -*- nroff -*- .SH NAME \fBconsoletype \- print type of the console connected to standard input .SH SYNOPSIS \fBconsoletype [\fIfg\fR] .SH DESCRIPTION \fBconsoletype prints the type of console connected to standard input, and checks whether the console connected to standard input is the current foreground virtual console. With no arguments, it prints \fIvt\fR if console is a virtual terminal (/dev/tty* or /dev/console device if not on a serial console), \fIserial\fR if standard input is a serial console (/dev/console or /dev/ttyS*) and \fIpty\fR if standard input is a pseudo terminal. .SH RETURN VALUE \fBconsoletype when passed no arguments returns .TP \fI0 if on virtual terminal .TP \fI1 if on serial console .TP \fI2 if on a pseudo terminal. .TP When passed the \fIfg\fR argument, \fBconsoletype\fR returns .TP \fI0 if the console connected to standard input is the current virtual terminal .TP \fI1 otherwise.