Why binary piping text on screen is often a horck terminal

Imaginary situation: . You used mysqldump to back up the mysql database. This database contains columns that are blobs. This means that your β€œtext” dump files contain both strings and binary data (are binary data stored as strings?)

If you click this file on the screen

$ cat dump.mysql

You often get unexpected results. The terminal will start beeping, and then the output will end scrolling with youll, which often contain garbage characters entered on your terminal, because through youd they typed them, and sometimes your prompts and everything you type will be garbage characters.

Why is this happening? In other words, I think Im looking for an overview of what actually happens when you store binary strings in a file, and when you cat these files and when the cat results are reported to the terminal, and any other steps.

+5
source share
3 answers

Start here: http://www.faqs.org/docs/Linux-HOWTO/Keyboard-and-Console-HOWTO.html

In particular, sections 3 (general concepts of the console) and section 4 (restarting your terminal).

It covers a little more than you say, but should provide you with what you need.

+5
source

, .

, , : 0x007 ( SYS V).

, .

+6

, ASCII ( UTF). . ,

echo "^[[0;31;40m" # The first ^[ comes from pressing Ctrl+v, Esc

, - . reset, .

+2

All Articles