1

I compared the CTRL+L in the Linux Debian terminal and the cls in Powershell.

When I pressed CTRL+L, it doesn't really clear the screen, it just prints newlines a few times. But when I type cls in Powershell, it cleared the screen.

Why isn't the terminal clearing the screen like in Powershell?

Anderson
  • 139
  • 2
    Why would it? Why would clearing the screen have anything to do with command history? – Stéphane Chazelas May 31 '14 at 06:55
  • It's a mistaken notion to believe that key combinations, commands, etc. that work on Windows or a shell such as Powershell on Windows, have any commonality on other OSes such as Linux and OSX. Deal with them all individually and do not be surprised that they are radically different. – slm May 31 '14 at 08:37
  • 1
    Why do you expect a key combination in one application in one operating system to have the same effect as an unrelated command name in a different application on another operating system? – Gilles 'SO- stop being evil' May 31 '14 at 13:49

1 Answers1

8

Ctrl-L is the ASCII form-feed character.

A terminal emulator could interpret Ctrl-L like a teletype1 would have, scrolling everything currently on the screen off the top. That would give an effect like cls in the Windows console or PowerShell, except that the prompt would remain at the bottom of the terminal window.

Most full-screen terminal-based programs on Unix type systems interpret it instead as "redraw the screen."

The command you actually want is clear.


  1. The ASCII control character commands were defined for teletypes. Glass terminals came later.
Warren Young
  • 72,032