You need to verify which virtual machines that begin with the prefix "web-" are currently running in all zones of your production project. You want the output to show only the VM name and its zone in a concise table so you can quickly share it with the team. Which single gcloud command meets these requirements?
The gcloud compute instances list command returns all VM instances in the chosen project. Adding a filter limits the results to VMs whose status is RUNNING and whose names start with web-. The ~ operator performs a regular-expression match; ^ anchors the pattern to the start of the string. The --format flag lets you control the output, and table(name,zone) prints only the instance name and zone in a compact table. The other commands either do not list instances, omit the required filter for the RUNNING status, or fail to restrict the columns displayed.
Ask Bash
Bash is our AI bot, trained to help you pass your exam. AI Generated Content may display inaccurate information, always double-check anything important.
What does the ~ operator do in the gcloud filter expression?
Open an interactive chat with Bash
How does the --format flag improve output readability in gcloud commands?
Open an interactive chat with Bash
Why is filtering by 'status=RUNNING' important in the gcloud command?
Open an interactive chat with Bash
What does the ~ operator do in the gcloud command?
Open an interactive chat with Bash
How does the --format flag control the output in gcloud commands?
Open an interactive chat with Bash
Why is filtering by status=RUNNING important in this command?
Open an interactive chat with Bash
GCP Associate Cloud Engineer
Ensuring successful operation of a cloud solution
Your Score:
Report Issue
Bash, the Crucial Exams Chat Bot
AI Bot
Loading...
Loading...
Loading...
Pass with Confidence.
IT & Cybersecurity Package
You have hit the limits of our free tier, become a Premium Member today for unlimited access.
Military, Healthcare worker, Gov. employee or Teacher? See if you qualify for a Community Discount.
Monthly
$19.99
$19.99/mo
Billed monthly, Cancel any time.
3 Month Pass
$44.99
$14.99/mo
One time purchase of $44.99, Does not auto-renew.
MOST POPULAR
Annual Pass
$119.99
$9.99/mo
One time purchase of $119.99, Does not auto-renew.
BEST DEAL
Lifetime Pass
$189.99
One time purchase, Good for life.
What You Get
All IT & Cybersecurity Package plans include the following perks and exams .