This question already has an answer here:

How can I get the list of amazon ec2 instance using aws command line tool? I checked various available commands but could not fount one suitable for this purpose.

marked as duplicate by Community May 6 '16 at 5:41

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

aws ec2 describe-instances --filters "Name=instance-state-code,Values=16"

Valid values for this filter:

The valid values are: 0 (pending), 16 (running), 32 (shutting-down), 48 (terminated), 64 (stopping), and 80 (stopped).

Sourced from the CLI docs: http://docs.aws.amazon.com/cli/latest/reference/ec2/describe-instances.html


classic ec2 client:

  $ ec2-describe-instances

it has billions of filters, well more than 10.

current awscli

$ aws ec2 describe-instances
  • 1
    FYI, the classic AWS tools are going the way of the dodo - we should be recommending to people that they use awscli now. – EEAA May 4 '16 at 17:35

Not the answer you're looking for? Browse other questions tagged or ask your own question.