I tried "cls" but not worked. What is the command to completely clear the terminal window.
-
cs50.stackexchange.com/a/28375/21075 – Ankur Parihar Feb 22 '18 at 9:05
clear
word is used to clear the contents in the terminal window, although it does not literally clear things, scroll up to see the previous things inside the terminal.
If you're using macOS you have to use ⌘ + k
instead of the ctrl + k
command which was suggested by a few other users :)
If you want the screen to be cleared literally and want to keep the history of the commands too, then better use reset
command.
Use ctrl + k
to clear it.
All other methods would just shift the terminal screen and you can see previous outputs by scrolling.
Use of ctrl + k
will remove previous contents plus it will preserve your command history too which you can access by up down arrow keys.
ctrl + k
does not seem to be working (probably used to work?).
The following works to clear the terminal:
ctrl + L
clear
command in the terminal