Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm a heavy bash user and konsole is my preferred environment. I know I can use the keyboard command ctrl+shift+x to clear the scrollback buffer, but there's certain points in my scripts where I would like that to occur. How can I clear konsole's scrollback buffer using the command line, bash, or any other shell?

share|improve this question
up vote 7 down vote accepted

This will do it:

echo -e "\e[3J"

Found here. Works in regular xterm too.

share|improve this answer
nice! good find and works perfectly! – Joshua Kersey Oct 24 '09 at 4:32
didn't work for me on SUSE in a xterm with bash shell. – djangofan Mar 19 '11 at 20:00
I liked echo -ne "\e[3J" better as it avoids printed line-break. – Patrick B. Mar 22 '12 at 12:01
@PatricB.: true, though in this context, I'm expecting him to incorporate it into a script – retracile Mar 22 '12 at 16:26
@PatrickB. Thanks for the reminder on the -n. :) – Joshua Kersey Jan 21 '13 at 20:53

Your Answer


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.