Clear Ubuntu terminal or WSL without clearing history – Code Example

In this article we will provide your code for clearing Ubuntu terminal or WSL windows command line without clearing history. Use clear command with -x attribute.

Note: Remember to use lowercase x.

Code Example –

akash@LAPTOP-389NRSIQ: clear -x
clear -x to clear the terminal but preserving the history