I tried "cls" but not worked. What is the command to completely clear the terminal window.


6 Answers 6


The shortcut Ctrl + L should do the job either.


If you're using macOS you have to use ⌘ + k instead of the ctrl + k command which was suggested by a few other users :)


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 want the screen to be cleared literally and want to keep the history of the commands too, then better use reset command.

  • But this does not clear the scroll back
    – yonarp
    May 16, 2021 at 22:18

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

You must log in to answer this question.