Is there a way to export results from BigQuery to a csv file using
bq query "SELECT name, count FROM mydataset.babynames WHERE gender = 'M' ORDER BY count DESC LIMIT 6" .
I found that we can specify the parameter --destination_table = mydataset.happyhalloween, which will be written to another table. Is there a way to write to a file?
I also tried bq query "SELECT name, count FROM mydataset.babynames WHERE gender = 'M' ORDER BY count DESC LIMIT 6"> output.txt
But this creates additional headers.

But I want the results to be written to a file
, :
bq query --format = csv "SELECT commit FROM [bigquery-public-data: github_repos.commits] LIMIT 10" > output.txt
, output.txt
