Setting a default region in AWS CLI keeps routine commands pointed at the intended AWS endpoints without repeating --region on every request. That reduces mistakes when switching between regions, prevents resources from appearing to be missing, and keeps profile-backed automation aligned with the environment it is meant to target.
The AWS CLI stores the saved region in the shared config file for the active profile, usually ~/.aws/config on Linux and macOS or %USERPROFILE%\.aws\config on Windows. The aws configure set region <region-code> command writes that value locally, aws configure get region reads it back from the profile configuration, and aws configure list shows which source is currently providing the effective region setting.
The saved profile value is only the default. A one-off --region parameter overrides both the shared config file and any region environment variables for that single command, while AWS_REGION overrides AWS_DEFAULT_REGION and the profile setting for the current shell session. That makes aws configure list the safest final check when a stored value looks correct but commands still use a different region.
$ aws --version
$ aws configure get region
No output means the default profile does not have an explicit saved region yet.
$ aws configure set region ap-southeast-1
This writes region = ap-southeast-1 under the [default] section in ~/.aws/config and creates the shared config file if it does not exist yet.
$ aws configure get region ap-southeast-1
aws configure get reads the stored profile value directly, so it is the cleanest check that the default profile was updated.
$ aws configure list NAME : VALUE : TYPE : LOCATION profile : <not set> : None : None access_key : <not set> : None : None secret_key : <not set> : None : None region : ap-southeast-1 : config-file : ~/.aws/config
If the TYPE column shows env instead of config-file, the current shell is overriding the saved default with AWS_REGION or AWS_DEFAULT_REGION. A --region parameter overrides both for a single command.
$ aws configure set region us-west-2 --profile audit
This writes the setting under [profile audit] in the shared config file and leaves the [default] profile unchanged.
$ aws configure get region --profile audit us-west-2
The --profile selector changes which section is read and written, so this confirms the named profile without depending on the global default.
$ sed -n '1,20p' ~/.aws/config [default] region = ap-southeast-1 [profile audit] region = us-west-2
The region belongs in ~/.aws/config, not in ~/.aws/credentials. On Windows, inspect %USERPROFILE%\.aws\config instead, or check AWS_CONFIG_FILE if the shell overrides the default path.
Related: How to find the AWS CLI config file