how to limit aws eks error and help page output in shell and show only N first lines? head not working

70 Views Asked by At

i m trying diff commands in aws eks and when there is wrong cmd it spits out too long of output.

aws kubectl get pod

usage: aws [options] <command> <subcommand> [<subcommand> ...] [parameters
]
To see help text, you can run:

  aws help
  aws <command> help
  aws <command> <subcommand> help

aws: error: argument command: Invalid choice, valid choices are:

accessanalyzer                           | account

acm                                      | acm-pca

alexaforbusiness                         | amp

amplify                                  | amplifybackend

in case i only want to see the error msg and not 2 screens of all possible cmds how to limit the output in case of error?

i tried :

aws eks describe-cluster --voice wrongparameter | head 10

but it s not working

1

There are 1 best solutions below

6
Saifeddine Rajhi On

There is no such command aws kubectl get pod !!

It is either kubectl get pod to list pods in current namespace if you have kubectl cli installed and configured with the correct context or aws eks describe-cluster --name demo to describe your AWS Kubernetes cluster with name demo in the current region and profile.