The documentation says the following:

[-]opost postprocess output

I don't understand what this means. I have tried to disable this flag to see what it does:

stty -opost -F /dev/pts/0

And I have typed the ls command, and the result had the first line indented:

enter image description here

I still don't get what this flag does!


1 Answer 1


stty -opost deactivates post-processing output. For example, normally sending a <LF> (U+00A0) character to the terminal will automatically insert a <CR> (U+000D) character, to make the cursor go to the beginning of the next line. Most importantly, setting -opost deactivates all processing of output, irrespective of any other output options.

See the manual page for stty(1) for details.

  • So if for example the ocrnl is set, and I disable the opost flag, then the ocrnl flag will be ignored (also all other similar flags responsible for processing of output will be ignored)?
    – user259241
    Nov 6, 2017 at 17:58
  • Why not try it out? stty -opost ocrnl; echo -e 'aaa\nbbb'; stty sane
    – AlexP
    Nov 6, 2017 at 18:11
  • While this is useful information, it is certainly not a comprehensive answer. E.g. I discovered that opost controls whether or not an LF after a full line of text is suppressed. E.g. for an 80 chars wide terminal, outputting 80 dots followed by an LF will not cause a blank line to appear if opost is set.
    – Arne Vogel
    Sep 1, 2018 at 19:13
  • 4
    "deactivates the output processing" and the manual page all give the same (useless) information: That it suppresses output processing. The question is about what that output processing is.
    – toolforger
    Apr 2, 2019 at 5:23
  • The IBM documentation gives a bit more detail. For options like ONLCR it says "If OPOST and ONLCR are set...". So turning off OPOST turns off ONLCR even if the ONLCR bit is set. Same goes for ONOCR, OCRNL, and ONLRET.
    – Darryl
    Mar 15, 2023 at 18:01

You must log in to answer this question.

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