I know about the Linux clear command, but it just moves the previous output from the visible part of terminal window (KDE Konsole). I can still scroll up and see all previous text. Is there similar command that can erase entire content of a terminal window? (Something like clc in matlab.)


I'm sure you could make a command with dbus. But there is a shortcut for clear scrollback and reset by default. Ctrl + shift + x.

| improve this answer | |
  • Does "Ctrl + shift + x" work only in konsole? – rozcietrzewiacz Aug 9 '11 at 8:11
  • 1
    I don't know. I don't use anything else – xenoterracide Aug 9 '11 at 15:36
  • 1
    Ctrl+Shift+X does not work for me in Konsole Version 2.12.3 Ctrl+Shift+K does work – see superuser.com/a/123196/664 – Piotr Dobrogost Mar 22 '14 at 17:38
  • Thanks @PiotrDobrogost, the Ctrl+Shift+K worked for me with a slightly older version of Konsole. – Joshua Detwiler May 22 '18 at 19:49

reset is enough. No need to explicitly clear scrollback with it.

| improve this answer | |
  • 2
    reset is not working in Konsole – sivic Aug 9 '11 at 17:45

The RIS sequence (\ec) indeed doesn't clear history (Bug 171598), but in KDE 4 there's another sequence that does specifically clear history: \e[3J -- Bug 158235.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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