Home > Blockchain >  AWS CLI | esc return text
AWS CLI | esc return text

Time:05-09

How do I escape the AWS CLI return text? i.e. go back to ~$:

For example:

~$: aws s3api list-buckets
BUCKETS 2021-01-21T10:19:17 00:00       mybucket
BUCKETS 2021-05-18T11:37:38 00:00       foobarmadness
OWNER   itsbritneybitch
(END)

CodePudding user response:

Just press q to exit back to your shell.

The q keypress serves as a quit signal for whatever the pager the aws cli uses.

CodePudding user response:

It looks like your AWS command-line tools are configured to pipe their output through a "pager" - a tool to display one page (screenful) of output at a time.

The simplest pager is called more, because it displays one page then waits with the prompt "--More--" for you to request the next page or exit. The more advanced tool commonly used is called less (cheekily documented as "the opposite of more"), which allows you to freely scroll up and down the output.

Both tools can be exited by pressing q.

You can customise the pager used by most tools, including its command-line options, by setting the environment variable $PAGER. For instance, if you set PAGER='/usr/bin/less -FX' then less will run in a mode that automatically exits if the output is smaller than the screen.

  • Related