```bash export PGPASSWORD=xxxx psql -h xxx_host -U xxx_user -p xxx_port -d xxx_db -q -A -F ',' -f xxx_query.sql > xxx_output.csv ```