[BusyBox] Re: distinguishing console and terminal devices

Jim Bauer jfbauer at nfr.com
Tue May 24 13:51:39 UTC 2005


On Tuesday 24 May 2005 06:37, Bahadir Balban wrote:
> Hi,
> 
> I'm a bit confused about terminal devices. console(4) man page says:
> 
> "There are 63 consoles /dev/ttyn where 1<= n <= 63". It also says:
> "The _current_ console is addressed by /dev/console or /dev/tty0"
> 
> On tldp text-terminal how-to it says:
> 
> "/dev/tty stands for the _controlling_ terminal"
> 
> Now is it true that /dev/console = /dev/tty0 = /dev/tty?

They are all different.

/dev/tty always refers to the process's current tty.  If two process
open up /dev/tty and write to it, there is a very good chance the output
will be in two different locations.

The virtual consoles/terminals you can switch to via ctrl-alt-Fx
(or alt-Fx) are /dev/tty1 (F1), /dev/tty2 (F2), /dev/tty3(F3),...
/dev/tty0 always referrs to the currently active one.

/dev/console is used for some kernel messages.  Some other things may
write to it like syslogd.



More information about the busybox mailing list