Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to disable pagination for AWS CLI help output?

I want to display some help text, and search it with grep.

aws ec2 help | grep instance

AWS CLI uses more to paginate the help.

To disable it I've already tried:

aws --no-cli-pager ec2 help | grep instance

export AWS_PAGER=''; aws ec2 help | grep instance

and changing cli_pager in config file:

[default]
cli_pager=

It still uses the pager.

I'm using AWS CLIv2 Windows version on Cygwin.

How does one disable it?

like image 579
Kshitiz Sharma Avatar asked Oct 23 '25 09:10

Kshitiz Sharma


1 Answers

There are two ways to disable pagination in the AWS CLI.

1: Using the cli_pager option in the config file:

[default]
cli_pager=

2: Using the AWS_PAGER environment variable:

$ export AWS_PAGER=""

Please note: They only work if you’re using the AWS CLI version 2. They aren’t available if you run AWS CLI version 1. For information on how to install version 2, see Installing, updating, and uninstalling the AWS CLI version 2.

like image 163
Dennis Traub Avatar answered Oct 24 '25 23:10

Dennis Traub