# ttyu vs cuau



## j4ck (Aug 7, 2013)

Hi,

What is/are the difference(s) between /dev/ttyu* devices and /dev/cuau*? I can connect to a remote host via /dev/cuau2 and also /dev/ttyu2.


----------



## cpm@ (Aug 16, 2013)

j4ck said:
			
		

> What is/are the difference(s) between /dev/ttyu* devices and /dev/cuau*?



The device names used for serial port devices on FreeBSD are `/dev/cua[a-z][0-9]' for dial-out devices and `/dev/tty[a-z][0-9]' for dial-in devices. Read the following related article for more information:

http://frank.harvard.edu/~coldwell/terminals/#Special%20Files.


----------



## aragats (May 19, 2017)

So which device node should be used when logging in a *NIX box via serial port from FreeBSD?
Both /dev/ttyX and /dev/cuaX seem to work.


----------



## SirDice (May 19, 2017)

From uart(4):

```
FILES
     /dev/ttyu?       for callin ports
     /dev/ttyu?.init
     /dev/ttyu?.lock  corresponding callin initial-state and lock-state
                      devices

     /dev/cuau?       for callout ports
     /dev/cuau?.init
     /dev/cuau?.lock  corresponding callout initial-state and lock-state
                      devices
```


----------



## aragats (May 19, 2017)

Right, thanks! But I'm a little confused since they both (ttyX and cuaX) work the same way to connect to a serial console.
So, it's seems to be more logical to use /dev/cuaX in such case, but I'm trying to understand the internals.


----------



## SirDice (May 22, 2017)

aragats said:


> But I'm a little confused since they both (ttyX and cuaX) work the same way to connect to a serial console.


Yeah, I think this is mainly because the ttyu* are the more traditional serial _input_ ports. Think old-school, serial, terminal connections and dial-in modems.


----------

