1

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

1
8

The shortcut Ctrl + L should do the job either.

4

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

2

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.

1

If you want the screen to be cleared literally and want to keep the history of the commands too, then better use reset command.

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

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.

0
0

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.