Fix Terminal Gibberish with reset Command in OS X
If you’ve ever accidentally used cat on a binary file, you’ll have seen the gibberish that results and how it can totally screw up your Terminal window with loads of weird characters. Of course there are many other ways to bork up your command line prompt which seems to become unrecoverable through the typical clear command string, but there is a really easy trick to use if you happen to experience this.
The easy way to repair bizarre character representation and a messed up Terminal is to use the reset command. All you need to do is type ‘reset’ when you’re in a screen full of gibberish text:
reset
Hit return, and your Terminal will reset itself, and everything should appear to be good as new again. If all else fails, you can always exit and re-login, or launch a new shell too.
Try it out the next time your command line is messed up. This works in Mac OS X Terminal, but also any variation of Linux, BSD, or other unix flavors too. A great little trick to have in your command line repertoire.
Thanks for this hint, saved me hours!