Disabling the AWS CLI pager keeps command output moving directly to the terminal, a pipe, or a redirected file instead of opening an interactive viewer. That matters in repeated admin work, shell loops, and copy-paste command runs where output needs to return immediately instead of pausing inside less or more.
In AWS CLI version 2, long terminal output can be sent to a pager. The effective pager can come from AWS_PAGER, the profile-backed cli_pager setting, or the shell's generic PAGER fallback. Setting the pager value to an empty string tells the CLI to print output normally instead of launching a pager program.
The persistent setting lives in the shared AWS CLI config file and is stored per profile, so default and named profiles can be controlled independently. A non-empty AWS_PAGER value still overrides the stored setting for the current shell, and --no-cli-pager remains the safer one-command escape hatch when the profile itself should stay unchanged.
Related: How to find the AWS CLI config file
Related: How to use environment variables in AWS CLI
Related: How to switch AWS CLI profiles
Steps to disable the AWS CLI pager:
- List the configured profiles when the pager should be disabled somewhere other than default.
$ aws configure list-profiles default audit operations-admin
If only the default profile is in use, keep default in the following commands. Each profile stores its own cli_pager value.
- Store an empty pager value for the target profile in the shared AWS CLI config file.
$ aws configure set cli_pager "" --profile default
This is the persistent profile-backed method. The same command works for any named profile by replacing default with that profile name.
- Read the stored value back and confirm it is blank instead of a pager program name.
$ printf '[%s]\n' "$(aws configure get cli_pager --profile default)" []
Empty brackets confirm that cli_pager is set to an empty string rather than less, more, or another pager command.
- Inspect the shared config file and confirm the profile now contains cli_pager =.
$ sed -n '/^\[default\]/,+4p' ~/.aws/config [default] region = us-east-1 cli_pager =
- Repeat the same setting for each named profile that should stop opening a pager.
$ aws configure set cli_pager "" --profile audit $ sed -n '/^\[profile audit\]/,+4p' ~/.aws/config [profile audit] region = us-east-1 output = yaml cli_pager =
Named profiles use [profile name] sections in ~/.aws/config, so disabling the pager for default does not automatically change audit, production, or any other named profile.
- Clear or replace the shell override when commands still open a pager after the config change.
$ printenv AWS_PAGER less -FRX $ unset AWS_PAGER
A non-empty AWS_PAGER value overrides the stored cli_pager setting for the current shell session. Use export AWS_PAGER="" when the current shell should disable paging without editing the shared profile config.
- Run a long local-output command and confirm it prints directly to the terminal instead of opening less or more.
$ aws ec2 describe-regions --generate-cli-skeleton output --region us-east-1 { "Regions": [ { "OptInStatus": "OptInStatus", "Geography": [ { "Name": "Name" } ], "RegionName": "RegionName", "Endpoint": "Endpoint" } ] }This command generates output locally, so it is safe for pager testing without AWS credentials or an API call. When the stored profile should stay unchanged, run the same command with --no-cli-pager instead of setting cli_pager in the config file.
Mohd Shakir Zakaria is a cloud architect with deep roots in software development and open-source advocacy. Certified in AWS, Red Hat, VMware, ITIL, and Linux, he specializes in designing and managing robust cloud and on-premises infrastructures.
