1CONSOLETYPE(1) General Commands Manual CONSOLETYPE(1)
2
3
4
6 consoletype - print type of the console connected to standard input
7
9 consoletype [stdout] [fg]
10
12 consoletype prints the type of console connected to standard input, and
13 checks whether the console connected to standard input is the current
14 foreground virtual console. With no arguments, it prints vt if console
15 is a virtual terminal (/dev/tty* or /dev/console device if not on a
16 serial console), serial if standard input is a serial console
17 (/dev/console or /dev/ttyS*) and pty if standard input is a pseudo ter‐
18 minal.
19
21 consoletype when passed no arguments returns
22
23 0 if on virtual terminal
24
25 1 if on serial console
26
27 2 if on a pseudo terminal.
28
29 When passed the stdout argument, consoletype returns
30
31 0 in all cases, and prints the console type to stdout.
32
33 When passed the fg argument, consoletype returns
34
35 0 if the console connected to standard input is the current vir‐
36 tual terminal
37
38 1 otherwise.
39
40
41
42RH Red Hat, Inc CONSOLETYPE(1)