如何使用AWS CLI查找EC2实例的操作系统 [英] How to find OS of an EC2 instance using AWS CLI

查看:902
本文介绍了如何使用AWS CLI查找EC2实例的操作系统的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何使用AWS CLI查找在EC2实例上运行的操作系统。

How can you find out the OS running on an EC2 instance using AWS CLI.

ec2 describe-instance 命令会吐出很多信息,但是没有任何信息表明操作系统。

The ec2 describe-instance command spits out a lot of information , but there is nothing indicating the OS .

我也尝试在特定图像上使用 ec2 describe-images 。再次,似乎没有任何操作系统指示。

I also tried ec2 describe-images on a specific image. Again, there doesn't seem to be any indication of OS.

Help ..?

推荐答案

下面是列出平台字段的一种快速方法,该字段至少可以区分Windows和Linux:

Here's a quick way to list the Platform field, which at least distinguishes between Windows and Linux:

aws ec2 describe-instances --query 'Reservations[*].Instances[*].[InstanceId,Platform]' --output text
i-78b4ef47  windows
i-b8ae3386  windows
i-9d3611a2  None
i-1c57c651  windows
i-a241ec91  None
i-7d26b630  None

这篇关于如何使用AWS CLI查找EC2实例的操作系统的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆