A system administrator is troubleshooting a Docker container named webapp-01 that fails to remain in a running state. To diagnose the issue, the administrator needs to view the last 10 lines of the container's standard output and standard error streams. Which of the following commands should the administrator use to accomplish this task?
The correct command is docker logs --tail 10 webapp-01. The docker logs command fetches the logs written to STDOUT and STDERR by the specified container, even after the container has stopped. The --tail option limits the output to the specified number of lines from the end of the log. None of the distractors use a valid docker logs option for tailing, interact with the wrong tool, or rely on systemd journal entries that Docker does not create by default.
Ask Bash
Bash is our AI bot, trained to help you pass your exam. AI Generated Content may display inaccurate information, always double-check anything important.
What does the `docker logs` command do?
Open an interactive chat with Bash
What is the purpose of the `--tail` option in `docker logs`?
Open an interactive chat with Bash
Why is `journalctl` not suitable for viewing Docker container logs?
Open an interactive chat with Bash
CompTIA Linux+ XK0-006 (V8)
Services and User Management
Your Score:
Report Issue
Bash, the Crucial Exams Chat Bot
AI Bot
Loading...
Loading...
Loading...
IT & Cybersecurity Package Join Premium for Full Access