You have Viewer access to a project and need a quick gcloud command that shows only the names and zones of all Compute Engine virtual machines that are currently in the RUNNING state across every region. Which command meets the requirement without returning stopped instances or extra columns?
gcloud compute instances list --filter="status=RUNNING" --format="table(name,zone)"
The gcloud compute instances list command is the standard way to enumerate VM instances. Adding the filter flag with status=RUNNING restricts the results to running VMs, and the format flag lets you choose which fields are shown. Using table(name,zone) produces a concise two-column output. The other options either use an invalid gcloud syntax, fail to filter by status at the API level, or attempt to parse output with grep rather than using gcloud's built-in filtering and formatting features.
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 --filter flag do in the gcloud command?
Open an interactive chat with Bash
How does the --format flag simplify gcloud output?
Open an interactive chat with Bash
Why is parsing output with tools like grep or awk less effective here?
Open an interactive chat with Bash
What is the purpose of the --filter flag in gcloud commands?
Open an interactive chat with Bash
What does --format="table(name,zone)" do in the gcloud command?
Open an interactive chat with Bash
Why is it better to use built-in filtering and formatting in gcloud over external tools like grep or awk?
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 $11.99
$11.99/mo
Billed monthly, Cancel any time.
$19.99 after promotion ends
3 Month Pass
$44.99 $26.99
$8.99/mo
One time purchase of $26.99, Does not auto-renew.
$44.99 after promotion ends
Save $18!
MOST POPULAR
Annual Pass
$119.99 $71.99
$5.99/mo
One time purchase of $71.99, Does not auto-renew.
$119.99 after promotion ends
Save $48!
BEST DEAL
Lifetime Pass
$189.99 $113.99
One time purchase, Good for life.
Save $76!
What You Get
All IT & Cybersecurity Package plans include the following perks and exams .