"CLS" Equivalent in BASH?

As far as I know, there isn't a way to do this any better than what clear does with bash.

I think it's a feature that could be built into the terminal you're using though. I know the Mac Terminal app has a 'Clear Scrollback' menu option (command + k) that does what you're asking for.


Why don't you try Ctrl+l (control, lowercase "L"). This works in most shells (err terminals)...

In OSX terminal -

Command ⌘+l (command, l) leads to removing last typed command from display.

Command ⌘+k (command, k) leads to removing/clearing all display buffer.

reset (type this in terminal) leads to reset of terminal in case display becomes garbled.

not sure of equivalent in other unix flavors.


You're probably looking for the reset command.

However, the scroll-back buffer is not a feature of bash but of the terminal program. You didn't say what terminal program you were using.