7

The commands of clear, Ctrl+L, or reset are not adequate. They do not clear my terminal screen, they just seem to scroll the window down so I can't see everything above.

I want it so that I can't scroll up and see any previous history.

Tim
  • 32,861
  • 27
  • 118
  • 178
  • Already answered in this thread: http://askubuntu.com/questions/191999/how-to-clear-bash-history-completely – Ghassen Rjab Apr 19 '15 at 10:06
  • 2
    Do you want to clear written commands too? I cannot understand why reset won't suit your purpose. – Esref Apr 19 '15 at 10:06
  • @GhassenRjab no, that question is about clearing the history, it won't affect the lines shown in the scrollback buffer. – terdon Apr 19 '15 at 11:15
  • 3
    Why is reset not adequate? – Tim Apr 19 '15 at 12:35
  • Which terminal emulator are you using? (ps $PPID should tell you that.) The commands you mentioned only send messages; it's up to the particular terminal emulator to respond to those messages, and there is some variation in exactly how they're handled. – deltab Apr 19 '15 at 20:30

1 Answers1

8

If you type reset it'll totally reinitialize your terminal instead of clearing your screen. You can setup a keyboard shortcut for that.

printf "\033c" also work well and takes less time. You can alias it by alias cls='printf "\033c"' too. Now when you type cls terminal should get cleared.

For more detailed explaination take a look at this Stack Overflow question.

Jacajack
  • 694
  • 2
    you can also do this GUI way navigating to terminal menu bar choose terminal and from there reset / reset and clear. – JoKeR Apr 19 '15 at 10:14