How do I type a carriage return control character, in Windows or in Linux?
I'd like to type a backspace character too.
4 Answers
In Linux, your keyboard will send carriage return if you type Ctrl-M, linefeed when you type Ctrl-J, and backspace when you type Ctrl-H. Can't say with Windows, since you can be typing into so many different kinds of text-input controls, including a console window.
In Windows, hold Alt and type 013 on the numpad.
In linux, backspace is Ctrl+H, carriage return is Ctrl+M
If you want to insert a literal carriage return/backspace, you must quote it. Quoting is program-specific, but usually (or at least in bash) Ctrl+V quotes the next character. Other programs have different quoting mechanism, e.g. Ctrl+Q in emacs or Meta+V in nano
Therefore:
- To insert a carriage return in
bash, you would press Ctrl+V then Ctrl+M - To insert a backspace in
nanoyou would press Meta+V then Ctrl+H - To insert a carriage return in
emacs, you would press Ctrl+Q then Ctrl+M
Edit: To insert another control character, look in this table in the first column. For example, to type an escape character you would press ^[ (Ctrl+[)
The decimal value for the ASCII carriage return character is 13. With Microsoft Windows, hold down the <ALT> key and type the numbers "13" on the numeric keypad; the row of numeric above QWERTY won't work. This will insert the "♪" character in to your document.
You can also copy the "♪" character from this answer and paste it in to your document as well.