How to turn off the pager for AWS CLI return value?

Just running into this issue myself, I was able to disable the behaviour by invoking the aws cli as AWS_PAGER="" aws ....

Alternatively you could simply export AWS_PAGER="" at the top of your (bash) script.

Source: https://github.com/aws/aws-cli/pull/4702#issue-344978525


You can also use --no-cli-pager in AWS CLI version 2.

See the "Client-side pager" section here https://docs.aws.amazon.com/cli/latest/userguide/cli-usage-pagination.html


You can disable pager either by exporting AWS_PAGER="" or by modifying you AWS cli config file.

export AWS_PAGER="" 

### or update your ~/.aws/config with 

[default]
cli_pager=

Alternatively, you can enable the default pager to output of less program as

export AWS_PAGER="less" 

or corresponding config change.

Ref: https://docs.aws.amazon.com/cli/latest/userguide/cli-usage-pagination.html#cli-usage-pagination-clientside