As per kubernetes cheatsheet why should we use below commands? what is the purpo . . .

kanchan upadhyay:
as per kubernetes cheatsheet why should we use below commands? what is the purpose?

source <(kubectl completion bash) # setup autocomplete in bash into the current shell, bash-completion package should be installed first.
echo "source <(kubectl completion bash)" >> ~/.bashrc # add autocomplete permanently to your bash shell.

Haikal:
it’s for autocompletion. meaning after you type “kubectl get”, then press “tab”, kubectl will suggest the valid subsequent word of your command.

Haikal:
if you don’t run the above command as in cheat sheet, it won’t have this intelligence, and the suggestion will be:
image.png

kanchan upadhyay:
oh okay, thanks for the explanation. Can this be used during CKA exam?

Hasan Marzooq:
Yes

OE:
I would also recommend the next two lines in the cheat sheet (the k alias). That allows you to run: k … instead of having to type in kubectl

kanchan upadhyay:
Thanks @OE that’s helpful