Is there a command to clear all of the history in a cygwin console window without losing the .bash_history?

link|improve this question

74% accept rate
This is a duplicate of this question, except that it isn't as well written. If you had written your question better, Erik Vold, without misnaming terminal output as "history" for starters, you wouldn't have had to explain what you were asking over and over in comments. This should be closed as a duplicate. – JdeBP Mar 11 '11 at 22:13
@JdeBP did you try the solution mentioned there? it does not work.. – erikvold Mar 11 '11 at 22:28
1  
@JdeBP Cygwin != *nix console... So, no dupe IMHO... Please don't be too harsh, try to be constructive in your criticism... – BloodPhilia Mar 11 '11 at 22:31
feedback

3 Answers

up vote 4 down vote accepted

Click Ctrl-L. It should clear everything without losing the .bash_history. `

link|improve this answer
1  
If necessary, you could embed ^L in a script, or even change the Bash prompt to clear the screen after each command. – CarlF Mar 11 '11 at 21:54
feedback

Also rm ~/.bash_history should work.

link|improve this answer
I want to keep the .bash_history, just want to clear it from the window. – erikvold Mar 11 '11 at 21:13
feedback

If you mean you want to clear the console window: install ncurses and then you can use:

tput clear
link|improve this answer
feedback

Your Answer

 
or
required, but never shown

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