How do I clear the Gnome terminal history?
You can use tput reset
.
Besides reset
and tput reset
you can use following shell script.
#!/bin/sh
echo -e \\033c
This sends control characters Esc-C
to the console which resets the terminal.
Google Keywords: Linux Console Control Sequences
man console_codes
says:
The sequence ESC c causes a terminal reset, which is what you want if the screen is all garbled. The oft-advised "echo ^V^O" will only make G0 current, but there is no guarantee that G0 points at table a). In some distributions there is a program reset(1) that just does "echo ^[c". If your terminfo entry for the console is correct (and has an entry rs1=\Ec), then "tput reset" will also work.
You can use the reset
command, that will reset the terminal settings.
I know you're on a gnome terminal, but I thought I'd answer with a tip for others who might be (like me) on a Mac:
If you're using Terminal.app
or iTerm.app
then Control+L
will scroll up so the terminal looks blank, but Cmd+K
will actually reset the terminal / clear scroll-back.
Or, if you're able to set keyboard preferences for your terminal you may be able to assign something like Ctrl+K
to input echo -e \\033c
as was mentioned above.