Is there a way to clear up what is displayed on the shell console (in ubuntu linux) in just a single key or two? When I get flood of lines from grep and that exceeds the height of the window, I want to quickly scroll back to the position where I typed the command after the prompt. I can do so if I had opened a fresh terminal before I type the command, and just go to the initial position. But if keep using the same terminal window, I have to manually find the position. Ctrl+l is not an answer because it just scrolls, and the contents of the terminal remains. I cannot use less because the colored output of grep does not show up in color.
|
|
||||
|
The
command, which is part of ncurses, and is located in the ncurses-bin package on Debian, will completely clear the console. Is that what you want? Brief summary of
As discussed in http://superuser.com/questions/122911/bash-reset-and-clear-commands, and as pointed out by Erik in Shell console clearing, |
|||||||
|
|
It's not an answer to your question, but you can use less, and maintain your color see: http://serverfault.com/questions/26509/colors-in-bash-after-piping-through-less hint: $ grep --color=always foo bar.txt | less -r |
|||
|
|
|
I usually just use:
From the
|
|||||||||
|
clsin DOS? – Iszi Mar 31 '11 at 18:28clsin DOS clears the contents of the console and returns you to a blank screen with a fresh command prompt. – Iszi Mar 31 '11 at 19:41clearis the counterpart tocls.resetdoes more. Both will probably work, but based on your description,resetis overkill. – Mikel Apr 1 '11 at 1:56