@user3346547 in your example
nine
is printed in the beginning of the next line because your stty
has onlcr
turned on which is converting \n
to \r\n
. If you turn that off, \n
actually moves the cursor below vertically without moving it horizontally similar to you example of \f
.