DEV Community

Discussion on: How to prepare yourself to CKAD exam

Collapse
 
dishijain14 profile image
Dishi Jain

echo "source <(kubectl completion bash | sed 's/kubectl/k/g' )" >> ~/.bashrc

Why do we need this line?
I ran following :
echo "source <(kubectl completion bash)" >> ~/.bashrc
alias k=kubectl
bash

These 3 work perfectly fine, what additional feature I get from the above line with sed? Can something go wrong? If so, can we open a new terminal during the exam?

Collapse
 
felipeschossler profile image
Felipe Schossler

If you don't use the line with sed, the autocomplete function with just the k letter will not work.

For example: instead typping kubectl + TAB for autocomplete, you just need to do k + TAB for autocomplete the command.

You can open a new bash section just typping bash in the command line.

If you have more questions just call me on my social medias and I help you :D