HEX
Server: Apache/2.4.65 (Ubuntu)
System: Linux ielts-store-v2 6.8.0-1036-gcp #38~22.04.1-Ubuntu SMP Thu Aug 14 01:19:18 UTC 2025 x86_64
User: root (0)
PHP: 7.2.34-54+ubuntu20.04.1+deb.sury.org+1
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,
Upload Files
File: //snap/google-cloud-cli/current/platform/bq/README.txt
bq - command-line utilities to access BigQuery service
Copyright 2011-2016 Google Inc.
https://cloud.google.com/bigquery/bq-command-line-tool-quickstart


Running bq from the command line
=====================================

1. Try out bq by displaying a list of available commands. Type:
  bq

2. To display help information about a particular command, type:
  bq help command_name

Authorizing bq to access your BigQuery data
=====================================

While the bq tool can be used without any setup, it is highly recommended
that you create and store authorization credentials to access your BigQuery
data. This can be done by using the 'bq init' command.

1. To create and store authorization credentials, type:
 gcloud init

2. This will provide a URL where you can authorize gcloud to act on your behalf
when accessing the BigQuery API. Visit this URL in a web browser, copy the
resulting code, and paste it on the command line when prompted by gcloud.

3. This step will store an OAuth token a file, which
will remain valid until revoked by the user.

Basic bq commands
=====================================

Note: If you have not run "bq init" (see above) to store authorization
credentials, you will be asked to do before any operation involving data.

The following commands have additional options. For more information about
a specific command type:
  bq help command_name

1. You can run a query using the 'bq query' command:
  bq query 'select count(*) from publicdata:samples.shakespeare'

2. To list objects present in a collection, use 'bq ls':
  bq ls

3. Create a new table or dataset with 'bq mk':
  bq mk my_new_dataset

4. Load data from a source URI to a destination table with 'bq load':
  bq load <destination_table> <source_uri> <schema>

Running bq in shell mode
=====================================

1. bq can be run in an interactive shell mode. To enter shell mode, type:
  bq shell

2. In shell mode, you will be presented a command prompt, which will display
your default project GUID and dataset, if these values have been set. For
example:
  projectguid> help
  projectguid> ls
  projectguid> query 'select count(*) from publicdata:samples.shakespeare'