Really clear termial in Linux/Unix
Issue
In windows command prompt, we can use cls
to clear screen. But this is not available on Linux or Mac.
Solution
We can type the following command:
printf '\33c\e[3J'
For curious, this part '\e[3J'
is a terminal escape command.
We can define an alias
in the file of .bashrc
and .zshrc
.
alias cls="printf '\33c\e[3J'"
And run.
source ~/.bashrc