Unlock the power of your data in the cloud! Get hands-on with Google Cloud's core data services like BigQuery and Looker to validate your practical skills in data ingestion, analysis, and management, and earn your Associate Data Practitioner certification!
Prepare and test your skills
Prepare and test your skills
Worked example. The correct answer is already marked and every option is explained below, so there is nothing to select here. To answer questions yourself, start the free trial.
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?
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.
Keep the momentum going with these hand-picked practice scenarios
Want more questions like this?
Get a free certification question every week.