Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

We do a lot of queries with binary data in them, and because of that, sometimes when I run "mysqladmin proc", my terminal gets messed up. Running reset fixes it, but I'd prefer to just prevent the problem in the first place. How can I strip these out with sed? Or is there a better way to do it?

share|improve this question
up vote 1 down vote accepted

You can pipe to cat -v (should show "non-printing" characters in escaped notation)

share|improve this answer
I'd vote you up if I had the rep. Thanks! – twk Dec 14 '10 at 23:01


sed 's/[^[:print:]]//g' inputfile
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.