If you're working with Amazon Web Services (AWS) and managing EC2 instances, you may need to identify the instance type of the EC2 instance for troubleshooting, optimization, or scaling purposes. This tutorial provides 2 methods how to get AWS EC2 instance type on Linux.
Method 1 - /sys/.../product_name file
The instance type can be found in the /sys/devices/virtual/dmi/id/product_name
file. Use cat
or similar command to check:
cat /sys/devices/virtual/dmi/id/product_name
Output example:
t3a.2xlarge
Method 2 - dmidecode command
The dmidecode
is a command that retrieves system hardware information. You can use it to extract the instance type by querying the system-product-name
field:
sudo dmidecode -s system-product-name
Leave a Comment
Cancel reply