Prepare and test your skills
Prepare and test your skills
Free sample question, answered and explained below. The Associate Data Practitioner practice bank has 1,156 more like it. Try 10 free: instant score, no account.
A data engineer is writing an automated bash script to ingest on-premises data into Google Cloud. The script needs to upload a local directory named /data/sales_records, which contains multiple nested subdirectories and CSV files, into a Cloud Storage bucket named gs://retail-analytics-lake.
Which gcloud command should the engineer use to perform this upload?
This command attempts to invoke a hypothetical sync sub-command under gcloud storage with an --all flag. In the Google Cloud CLI, directory synchronization is performed using gcloud storage rsync, not gcloud storage sync.
gcloud storage does not have a sync command group. Using this syntax causes the CLI to return a command-not-found error.--all flag is not a valid parameter for directory copying or synchronization in gcloud storage.gcloud storage rsync.cp).The Google Cloud CLI provided a sync --all command syntax. However, Google Cloud uses rsync for synchronization tasks and cp --recursive for recursive copy and upload tasks.
gcloud config set isThe gcloud config set command is used to configure properties for the local installation of the Google Cloud CLI, such as setting the active project ID, default compute zone, or active authentication account. For instance, running gcloud config set project [PROJECT_ID] sets the default project context for subsequent commands.
gcloud config manages metadata and client environment configurations. It has no functionality to transfer or upload files.gcloud config set project will either overwrite your local project property with an invalid string or produce a command argument error.gcloud config stores settings locally in configuration files.The requirement was to specify which Google Cloud project future gcloud operations should target by default (e.g., gcloud config set project retail-project-12345).
gcloud storage cp --recursive isThe gcloud storage cp command is the standard Google Cloud CLI utility used to copy data between local file systems and Google Cloud Storage, or between two cloud storage locations. When combined with the --recursive (or -r) flag, the command instructs the tool to traverse all nested folders, copying directories and their constituent files into the destination bucket while preserving folder hierarchy.
gcloud storage cp accepts local file system paths as the source argument and Cloud Storage URI schemes (gs://bucket-name) as the target destination.--recursive flag ensures that /data/sales_records and all nested child directories and CSV files are discovered and uploaded.gcloud storage CLI supports multithreaded and multiprocess operations natively, making it fast, reliable, and suitable for automated shell scripts.* and **) for granular file pattern selection.Using gcloud storage cp /data/sales_records gs://retail-analytics-lake --recursive directly targets the exact ingestion requirement with native Google Cloud tooling. It requires no complex configuration, performs automatic concurrency optimization, and reliably preserves the nested hierarchy of data objects.
This option attempts to use an upload verb with a --nested flag within gcloud storage. In the Google Cloud CLI ecosystem, file transfer actions (both uploads and downloads) are standardized under the cp (copy) command.
gcloud storage does not feature an upload command group; file loading is unified under gcloud storage cp.--nested flag in gcloud storage. Recursive directory copying requires the --recursive (or -r) flag.cp, mv, rm, cat, and ls) are used by gcloud storage to maintain consistency with shell environments.cp rather than dedicated upload or download subcommands.The Google Cloud CLI utilized separate high-level verbs like upload and download with a --nested flag, but it instead relies on standard cp syntax with the --recursive parameter.
Answer them yourself and get your score the moment you finish. No account needed.
Full access includes
Keep the momentum going with these hand-picked practice scenarios
Last updated