exam questions

Exam XK0-005 All Questions

View all questions & answers for the XK0-005 exam

Exam XK0-005 topic 1 question 12 discussion

Actual exam question from CompTIA's XK0-005
Question #: 12
Topic #: 1
[All XK0-005 Questions]

A Linux administrator needs to analyze a failing application that is running inside a container. Which of the following commands allows the Linux administrator to enter the running container and analyze the logs that are stored inside?

  • A. docker run -ti app /bin/sh
  • B. podman exec -ti app /bin/sh
  • C. podman run -d app /bin/bash
  • D. docker exec -d app /bin/bash
Show Suggested Answer Hide Answer
Suggested Answer: B 🗳️

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
Aamm033
Highly Voted 1 year, 2 months ago
Selected Answer: B
B is correct... exec option is for running containers -t for TTY and -i interactive
upvoted 5 times
...
linux_admin
Most Recent 11 months ago
B. podman exec -ti app /bin/sh The podman exec command allows a Linux administrator to enter a running container and perform operations inside the container. The -ti options specify that the administrator wants to run the command interactively with a TTY and with STDIN attached. The app in the command specifies the name or ID of the running container that the administrator wants to enter. The /bin/sh at the end of the command specifies the shell to use inside the container.
upvoted 4 times
linux_admin
11 months ago
In this case, the administrator wants to enter the container to analyze logs that are stored inside. To accomplish this, the administrator should run the following command: podman exec -ti app /bin/sh This command will enter the running container named app and open a shell inside the container. The administrator can then use standard Linux commands to analyze the logs and diagnose the issue with the failing application
upvoted 1 times
...
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...