Borislav Hadzhiev
Thu Sep 30 2021·2 min read
Photo by Grant Ritchie
To turn of the pager for an AWS CLI command, set the --no-cli-pager
parameter, e.g. aws ec2 describe-instances --no-cli-pager
. The --no-pager
parameter disables the pager for a single command.
aws ec2 describe-instances --no-cli-pager
The easiest way to disable the pager for all AWS CLI commands is to update your
credentials
file and set the cli_pager =
setting below a profile's
credentials.
On linux
and macOS
, the credentials
file is located at
~/.aws/credentials
.
On windows
the credentials
file is located at
C:\Users\USERNAME\.aws\credentials
.
This shows how to disable the pager for a profile named tester
, in the
credentials
file:
[tester] aws_access_key_id = YOUR_ACCESS_KEY_ID aws_secret_access_key = YOUR_SECRET_KEY cli_pager =
cli_pager
setting applies to a specific profile, so you would probably have to add it below the credentials of multiple profiles.An alternative is to set the AWS_PAGER
environment variable on your machine.
This applies to all profiles.
# on Linux and macOS export AWS_PAGER="" # on Windows setx AWS_PAGER ""
Linux
and MacOS
, add theexport AWS_PAGER=""
line to your shell's startup script, e.g. ~/.bashrc
.If the AWS_PAGER
environment variable is set to an empty string, it is applied
to all AWS CLI profiles on the machine.