sqlite3: Error: unknown command or invalid arguments: "once"
<p>According to the <a href="https://www.sqlite.org/cli.html" rel="nofollow">official documentation</a> this is how you can export a table to .csv:</p>

<pre><code>sqlite&gt; .header on
sqlite&gt; .mode csv
sqlite&gt; .once c:/work/dataout.csv
sqlite&gt; SELECT * FROM tab1;
sqlite&gt; .system c:/work/dataout.csv
</code></pre>

<p>However, on line 3 of this sequence of commands I get:</p>

<pre><code>Error: unknown command or invalid arguments:  "once". Enter ".help" for help
</code></pre>

<p>My path is valid, I have permission to write to that location. My sqlite3 version is</p>

<pre><code>sqlite&gt; .version
SQLite 3.8.2 2013-12-06 14:53:30 27392118af4c38c5203a04b8013e1afdb1cebd0d
</code></pre>

<p>running on Ubuntu 14.04</p>

<p>I have googled for this error message, nothing useful on it this far.</p>

<hr>

<p>FIX: </p>

<pre><code>sqlite&gt; .header on
sqlite&gt; .mode csv
sqlite&gt; .output dataout.csv 
sqlite&gt; SELECT * FROM tab1
</code></pre>

<p>should work for the current version. Otherwise update to a newer version.</p>