Note: All of the forms shown are equivalent.

Running commands interactively

_$: psql -c "SELECT * FROM client" <database>
_$: psql --command="SELECT * FROM client;" <database>

Running commands from a file

test.sql:
---------
SELECT * FROM client;
_$: psql -f test.sql <database>
_$: psql --file=test.sql <database>
_$: psql <database> < test.sql