skip to content
Alvin Lucillo

Save query result to a file

/ 1 min read

You can save the SQL result to a file instead of it being printed to the standard output.

sqlcipher app.db

# Provide the key
sqlite> PRAGMA key = 'your_key_here'

# Save the result to the output file named result
sqlite> .out result

# Run the query. Notice that result isn't printed to the standard output
sqlite> select * from users;

# Display result to standard output if you want
sqlite> .out stdout