Clearing terminal

Try printf '\033c'. This sends an escape sequence to the terminal, usually clearing all contents, including scrollback buffer.


clear DOES clear the terminal screen. I guess you're accessing the Terminal from a graphic interface and hence you're actually using an interface to the console, not the actuall console. This interface automatically "saves" your output history (The stuff you see when scrolling up). In a real console (no graphic interface), you can't just scroll up. In this case, the terminal is just a program that keeps logs of the console output.

If you open up a new Terminal window and close the current one, you'll start off with a fresh window. (You could also reinitialize manually by going to Terminal -> Reinitialize and clear")


Terminal running in Desktop Environment: enter image description here

Console without Desktop Environment: enter image description here