If you use the Windows command prompt often throughout your work day, you may want or need to periodically clear the command history. Is it possible to do so while the command prompt is still open? Today’s SuperUser Q&A post has the answer to a curious reader’s question.
Today’s Question & Answer session comes to us courtesy of SuperUser—a subdivision of Stack Exchange, a community-driven grouping of Q&A web sites.
SuperUser reader Alexander B. wants to know if it is possible to clear the history in the Windows command prompt:
When using the Windows command prompt, a person can press the up arrow key to view and retrieve old commands. Is it possible to erase the command history, and if so, how would a person do it?
Is it possible to clear the history in the Windows command prompt?
SuperUser contributor AFH has the answer for us:
There is a simple keyboard shortcut for doing so while the command prompt is still open, Alt+F7. Alternatively, the command history is cleared every time you exit and restart the command prompt.
If you want to explore further, you will find that there are very few questions about the command prompt that are not answered on the SS64 reference website.
Have something to add to the explanation? Sound off in the comments. Want to read more answers from other tech-savvy Stack Exchange users? Check out the full discussion thread here.