curl http://169.254.169.254/latest/user-data/
curl http://169.254.169.254/latest/meta-data/
curl http://169.254.169.254/latest/dynamic/instance-identity/document|grep region|awk -F\" '{print $4}'
(or)curl -s http://169.254.169.254/latest/dynamic/instance-identity/document | python -c "import json,sys; print json.loads(sys.stdin.read())['region']"
(or)curl -s 169.254.169.254/latest/meta-data/placement/availability-zone | sed 's/.$//'
All the above commands must be executed on the shell of the target instance
aws ec2 describe-instances --region us-east-1
aws ec2 start-instances --instance-ids i-04b97d9163360d14f
aws ec2 stop-instances --instance-ids i-04b97d9163360d14f
aws ec2 terminate-instances --instance-ids i-04b97d9163360d14f
aws s3 ls
aws s3 ls s3://okoye3
aws s3 sync s3://okoye3 .
aws s3 sync . s3://okoye3
if bucket is empty : aws s3 rb s3://name of the bucket
if bucket has contents : aws s3 rb s3://name of the bucket --force
For reference: docs.aws.amazon.com