49

To clear the SQLite console screen I tried cls, .cls, cls; and .cls; but no luck. Is there no cls command in SQLite?

user4157124
  • 2,809
  • 13
  • 27
  • 42
saeed
  • 497
  • 1
  • 4
  • 6

6 Answers6

83

To execute CLS command in the SQLite3 shell you need to do this: .shell cls

As simple as that, .shell args... allows you to execute CMD commands in the SQLite3 shell.

ivan0590
  • 1,229
  • 11
  • 18
  • 33
    Note that `.shell cls` is for Windows, use `.shell clear` for Unix and Linux. – Stian OK Aug 05 '15 at 22:35
  • In git bash, it moves the cursor to top of screen but does not clear the console. – mallaudin Oct 19 '16 at 07:44
  • 1
    @mallaudin that is because git bash has the same behavior as a Linux terminal so `clear` doesn't really clear the console. Try using `tput reset` or just `reset` in your git bash to actually clear the console. – Sumit Sep 06 '17 at 20:00
31

There is no clear command in the SQLite command-line client.

But, if you're on a unix-based system (includes Mac OS X) you can use: Ctrl+L

Update:
While my answer is quick and simple, if you're on a compatible OS, make sure you also check out ivan0590's answer about the .shell command. Definitely a "good to know" as well.

Timeout
  • 7,759
  • 26
  • 38
  • 1
    Here is a [thread on askubuntu](https://askubuntu.com/questions/434240/ctrll-in-terminal), explaining what `Ctrl+l` does, and why. –  Dec 19 '17 at 06:41
7

Depending on the shell. In Ubuntu -> .shell clear

OZ13
  • 256
  • 3
  • 4
6

On mac or Unix Operating systems:

   .shell clear

or:

   .shell reset
joan
  • 2,407
  • 4
  • 29
  • 35
5

.shell cls will always work(C'mon, if you are in windows). If you are using Linux/Unix/Mac OS, try using .shell clear

Arjun Praveen
  • 119
  • 2
  • 2
4

For Windows:

.shell cls

For Linux and Mac:

.shell clear
Super Kai - Kazuya Ito
  • 22,221
  • 10
  • 124
  • 129