sqlite3 app.db 'SELECT * FROM users LIMIT 5;'

Category: Databases & SQL

sqlite3 app.db 'SELECT * FROM users LIMIT 5;'

Run a SQL query from the shell

Executes the query and prints the rows, then exits. Without a command argument the CLI starts an interactive session. Related: .mode column for prettier output.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.