[[["이해하기 쉬움","easyToUnderstand","thumb-up"],["문제가 해결됨","solvedMyProblem","thumb-up"],["기타","otherUp","thumb-up"]],[["이해하기 어려움","hardToUnderstand","thumb-down"],["잘못된 정보 또는 샘플 코드","incorrectInformationOrSampleCode","thumb-down"],["필요한 정보/샘플이 없음","missingTheInformationSamplesINeed","thumb-down"],["번역 문제","translationIssue","thumb-down"],["기타","otherDown","thumb-down"]],["최종 업데이트: 2025-09-04(UTC)"],[],[],null,["# Executing shell commands on your container\n==========================================\n\nTo troubleshoot some isses, you might have to access the container to execute commands directly\non the container itself. You can access a container through a `bash` shell or through PowerShell using the\n[`kubectl exec` command.](https://kubernetes.io/docs/reference/generated/kubectl/kubectl-commands#exec)\n| **Note:** In the examples below, for PowerShell replace `/bin/bash` with `cmd.exe`, `powershell.exe`, or `pwsh.exe` depending on your version.\n\n1. Use `kubectl describe pods` to find the name of the Pod in your cluster that you want to connect to.\n\n In the following example, the command lists the suitecrm-0 pod. \n\n ```\n kubectl describe pods | grep Name\n\n Name: suitecrm-0\n ```\n2. Execute shell commands using one of the following methods:\n - Use `kubectl exec` to open a bash command shell where you can execute commands. \n\n ```\n kubectl exec -it pod-name -- /bin/bash\n ```\n\n The following example gets a shell to the suitecrm-0 pod: \n\n ```\n kubectl exec -it suitecrm-0 -- /bin/bash\n ```\n - Use `kubectl exec` to execute commands directly. \n\n ```\n kubectl exec -it pod-name -- /bin/bash -c \"command(s)\"\n ```\n\n The following example lists the root directory of the suitecrm-0 pod: \n\n ```\n kubectl exec -it suitecrm-0 -- /bin/bash -c \"ls /\"\n ```\n\nFor more information, see the\n[Kubernetes documentation](https://kubernetes.io/docs/tasks/debug-application-cluster/get-shell-running-container/)."]]