Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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.

share|improve this question
    
what terminal are you using? (bash, csh, etc.)? –  Nate Koppenhaver Dec 9 '11 at 3:21
1  
@NateKoppenhaver: terminal != shell ... the terminal is the program which displays the output of the shell and forwards the input of the user to the shell. terminal is something like xterm, urxvt, konsole, gnome-terminal etc... –  akira Dec 9 '11 at 6:43
    
@Jake: since the terminal holds the rendered text of the shell it is important to know which terminal you use... –  akira Dec 9 '11 at 6:44
    
@Jake: On your edit: As akira said, bash is not a terminal. It's a shell. –  grawity Dec 9 '11 at 7:59

2 Answers 2

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.

share|improve this answer
up vote 0 down vote accepted

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:

Bash: Reset and Clear Commands

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.