@@ -22,7 +22,7 @@ This page contains a list of commonly used `kubectl` commands and flags.
22
22
### BASH
23
23
24
24
``` bash
25
- source <( kubectl completion bash) # setup autocomplete in bash into the current shell, bash-completion package should be installed first.
25
+ source <( kubectl completion bash) # set up autocomplete in bash into the current shell, bash-completion package should be installed first.
26
26
echo " source <(kubectl completion bash)" >> ~ /.bashrc # add autocomplete permanently to your bash shell.
27
27
```
28
28
@@ -36,12 +36,12 @@ complete -o default -F __start_kubectl k
36
36
### ZSH
37
37
38
38
``` bash
39
- source <( kubectl completion zsh) # setup autocomplete in zsh into the current shell
39
+ source <( kubectl completion zsh) # set up autocomplete in zsh into the current shell
40
40
echo ' [[ $commands[kubectl] ]] && source <(kubectl completion zsh)' >> ~ /.zshrc # add autocomplete permanently to your zsh shell
41
41
```
42
- ### A Note on --all-namespaces
42
+ ### A note on ` --all-namespaces `
43
43
44
- Appending ` --all-namespaces ` happens frequently enough where you should be aware of the shorthand for ` --all-namespaces ` :
44
+ Appending ` --all-namespaces ` happens frequently enough where you should be aware of the shorthand for ` --all-namespaces ` :
45
45
46
46
``` kubectl -A ```
47
47
155
155
156
156
```
157
157
158
- ## Viewing, finding resources
158
+ ## Viewing and finding resources
159
159
160
160
``` bash
161
161
# Get commands with basic output
@@ -346,7 +346,7 @@ kubectl exec my-pod -c my-container -- ls / # Run command in existing po
346
346
kubectl top pod POD_NAME --containers # Show metrics for a given pod and its containers
347
347
kubectl top pod POD_NAME --sort-by=cpu # Show metrics for a given pod and sort it by 'cpu' or 'memory'
348
348
```
349
- ## Copy files and directories to and from containers
349
+ ## Copying files and directories to and from containers
350
350
351
351
``` bash
352
352
kubectl cp /tmp/foo_dir my-pod:/tmp/bar_dir # Copy /tmp/foo_dir local directory to /tmp/bar_dir in a remote pod in the current namespace
@@ -355,7 +355,7 @@ kubectl cp /tmp/foo my-namespace/my-pod:/tmp/bar # Copy /tmp/foo local fil
355
355
kubectl cp my-namespace/my-pod:/tmp/foo /tmp/bar # Copy /tmp/foo from a remote pod to /tmp/bar locally
356
356
```
357
357
{{< note >}}
358
- ` kubectl cp ` requires that the 'tar' binary is present in your container image. If 'tar' is not present,` kubectl cp ` will fail.
358
+ ` kubectl cp ` requires that the 'tar' binary is present in your container image. If 'tar' is not present, ` kubectl cp ` will fail.
359
359
For advanced use cases, such as symlinks, wildcard expansion or file mode preservation consider using ` kubectl exec ` .
360
360
{{< /note >}}
361
361
0 commit comments