connect to psql and run SQL command from command line
You don't need the \c in the command specified with -c, you can specify the database as a parameter to psql:

psql -U &lt;username&gt; -d some_db -c "DELETE from some_table; DELETE from another_table"