Is there a command to clear screen in SQLite3?
Asked Answered
H

6

53

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

Hendiadys answered 6/2, 2014 at 23:33 Comment(2)
"cls" is a DOS command, not a sqlite command.Instrumentality
Note quite - but this illudes the trick: ``` .print "\n\n\n\n\n\n\n\n\n\n\n\n" ```Sporogenesis
F
93

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.

Finnie answered 9/8, 2014 at 11:12 Comment(3)
Note that .shell cls is for Windows, use .shell clear for Unix and Linux.Fenestra
In git bash, it moves the cursor to top of screen but does not clear the console.Loon
@Loon 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.Modern
D
32

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.

Deutschland answered 6/2, 2014 at 23:36 Comment(1)
Here is a thread on askubuntu, explaining what Ctrl+l does, and why.Jubilate
D
7

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

Dara answered 29/5, 2017 at 9:13 Comment(0)
P
6

On mac or Unix Operating systems:

   .shell clear

or:

   .shell reset
Poitiers answered 9/10, 2017 at 10:14 Comment(0)
A
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

Arzola answered 21/8, 2021 at 17:43 Comment(0)
R
5

For Windows:

.shell cls

For Linux and Mac:

.shell clear
Redeeming answered 16/5, 2022 at 14:16 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.