BASH – fix the display

by nixcraft on August 8, 2006 · 5 comments

Sometime my R & D result into weird output. You will be not able to access your bash terminal. It will be full of wired character sequences that can lock down your display. These characters will hide what you type or character displayed into strange symbols.

Fixing the display

For example, accidentally you run cat command over binary file (try cat /bin/bash)
BASH - fix the display
To fix the display just type the reset command. It will initialization terminal again for you.
$ reset

If reset command failed to work type the following command to restore the session to a normal state:
$ stty sane

Press CTRL + L to clear the screen (or type clear command):
$ clear

Read man pages of stty and reset for more information:
man stty
man reset

Featured Articles:

Share this with other sys admins!
Facebook it - Tweet it - Print it -

We're here to help you make the most of sysadmin work. So, subscribe!

{ 5 comments… read them below or add one }

1 Joe August 9, 2006

I can’t count the number of times I’ve screwed my terminal up like this. Usually I just close the window. Thanks for the fix!

Reply

2 raj August 10, 2006

same here joe. I use to close bash window.

this is great fix

Reply

3 nixcraft August 10, 2006

Glad to know *this display fix* is helping all of you.

Appreciate your feedback

Reply

4 quantumtroll February 11, 2008

This did not work for me. I guess I’m stuck killing the terminal and starting over, but I don’t understand what could go so awry that stty and reset don’t help…

Reply

5 antonio luna March 10, 2009

Hi. I know this sounds stupid. But I would like to know, Where or what subject it. I can search while looking for classes so I can learn how to run Line Print Terminals.
I worked as a temp on a Mill for a few month operating a locomotive. while working there, I notice that came to fix the machinery got paid 200 $ hour. I want that money!!.

Reply

Leave a Comment

You can use these HTML tags and attributes for your code and commands: <strong> <em> <ol> <li> <u> <ul> <blockquote> <pre> <a href="" title="">
What is 11 + 4 ?
Please leave these two fields as-is:
Are you a human being? Solve the simple math so we know that you are a human and not a bot.




Previous post:

Next post: