Saturday, March 07, 2009

Fix a broken Linux shell

When you accidentally cat a binary file, it can leave your shell in a broken state as it can interpret some of the binary sequences as control characters.


You will see gibberish instead of normal letters/digits and the only recourse may seem to close this terminal and start another. But wait! The next time it happens, use the command reset instead!

You can see where I typed reset (second last line) and restored sanity. Note that even the name of the terminal window is back to normal!

No comments: