BASH Fix Display and Console Garbage and Gibberish on a Linux / Unix / macOS

Originally published at:

Sometimes my R & D result in the weird output on the screen. For example, accidentally I run cat command over binary file – cat /sbin/*. You will be not able to access your bash/ksh/zsh based 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. To clear gibberish all over the screen use the following method. This article describes how to really clear the terminal screen or reset terminal in Linux or Unix-like system. In other words, you will learn how to clear console garbage and gibberish without exiting the session on your Linux/Unix/macOS/BSD systems.