The documentation for termios says something like this:


Translate carriage return to newline on input (unless IGNCR is set).


Map CR to NL on output.

But what does "on input" and "on output" means exactly? This is what I think:

  • "on input" means when the terminal sends something to the tty device.
  • "on output" means when bash (or any other process) sends something to the tty device.

Am I correct?

  • "On output" means when the kernel sends something to the tty device. E.g. onlcr means translate a newline into CR-LF. So user space only has to worry about writing a newline. When the kernel eventually sends it to the tty, that's when the translation happens.
    – NickD
    May 24, 2017 at 2:01

2 Answers 2


You need to think of it in terms of a "dumb terminal" (such as a vt100) connected to a serial port on the computer, and looking at it from the perspective of the computer.

So "input" to the computer is when the terminal sends data to the computer; eg when you type on the keyboard.

Similarly "output" is when the computer sends things to terminal; eg when it prints something on the screen.

With a more modern setup (eg a Linux console) we still have the same concepts; "input" is stuff typed on the keyboard, "output" is stuff displayed on the screen.

This matches the standard conventions of "stdin" and "stdout".


That's correct, as far as termios goes, since it's only concerned with the communication between the terminal (a device for displaying characters combined with a device for entering characters) and the host computer.

That "on" may appear awkward, but it's just a short way of saying "in the process of doing input" or "in the process of doing output".

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .