File tree Expand file tree Collapse file tree 1 file changed +10
-11
lines changed
content/en/docs/tasks/tools/included Expand file tree Collapse file tree 1 file changed +10
-11
lines changed Original file line number Diff line number Diff line change @@ -26,19 +26,18 @@ Reload your shell and verify that bash-completion is correctly installed by typi
26
26
27
27
### Enable kubectl autocompletion
28
28
29
- You now need to ensure that the kubectl completion script gets sourced in all your shell sessions. There are two ways in which you can do this:
30
-
31
- - Source the completion script in your ` ~/.bashrc ` file:
29
+ #### Bash
32
30
33
- ``` bash
34
- echo ' source <(kubectl completion bash)' >> ~/.bashrc
35
- ```
36
-
37
- - Add the completion script to the ` /etc/bash_completion.d ` directory:
31
+ You now need to ensure that the kubectl completion script gets sourced in all your shell sessions. There are two ways in which you can do this:
38
32
39
- ``` bash
40
- kubectl completion bash | sudo tee /etc/bash_completion.d/kubectl > /dev/null
41
- ```
33
+ {{< tabs name="kubectl_bash_autocompletion" >}}
34
+ {{{< tab name="User" codelang="bash" >}}
35
+ echo 'source <(kubectl completion bash)' >>~ /.bashrc
36
+ {{< /tab >}}
37
+ {{< tab name="System" codelang="bash" >}}
38
+ kubectl completion bash | sudo tee /etc/bash_completion.d/kubectl > /dev/null
39
+ {{< /tab >}}}
40
+ {{< /tabs >}}
42
41
43
42
If you have an alias for kubectl, you can extend shell completion to work with that alias:
44
43
You can’t perform that action at this time.
0 commit comments