1

The linux terminal has a handy command named "clear" that removes all previous output. Unfortunately, when I run this command and then compile a rather large project with gcc, all previous output magically reappears in the terminal. This makes it hard to find errors and things.

Is there some way to permanently clear the terminal in Ubuntu?

Edit: I think it's bash - it's whatever the default for Ubuntu 10.04 is. Anyway, reset worked.

Jake
  • 150

2 Answers2

7

Assuming are you using Bash.

Clear command, just "move the page down". Clearing the current terminal view, but history is kept.

You should use the reset to permanently clear the terminal.

0

Eventually I found a better alternative to this. I use the following command:

alias clear=`echo -en "\ec"'

This removes everything from the current terminal window, similar to the default clear command, but the content is actually purged rather than just hidden a page up.

The reset command is probably more portable but it's also slower and does a lot more than just removing the visible text from the window.

Here is some further explanation:

What commands can I use to reset and clear my terminal?

Jake
  • 150