I displayed a binary file, and now my console is totally screwed up

(written by Frank Neumann)

Once in a while, it may happen to you that you try to read a binary file. Text viewers like more will interpret the input they get as control characters, to for instance change to an alternate character set. This may result in a strange looking prompt, made up of special characters. In such a case, you need to reset the terminal to its initial state. There are several ways to do this, here's what I use: You have to type (blindly):

echo ^V^O

Read this as: Control-V, Control-O. The sequence "Control-O" does just what we want: It resets the text attributes and character set, and also clears the screen. You have to mask the control character with Control-V, otherwise the shell would directly try to use the "Control-O" for its purposes.

Control-V Esc c is another useful sequence that does a more complete reset of the console (but you usually won't need to use it).

You can also avoid this problem by using less or most instead of more; both of these pagers are available in Debian. Be sure to set up a PAGER environment variable (in your .cshrc or .bashrc) so programs like man use your preferred pager instead.