Courseiva
Essential ToolseasyMultiple SelectObjective-mapped

EX200 Essential Tools Practice Question

Which TWO commands can be used to display the current date and time in a format like '2023-10-05 14:30:00'?

⚠ Common exam trap

Red Hat often tests the distinction between commands that display time in a raw format versus those that require explicit formatting; candidates may mistakenly choose `timedatectl` because it shows the current time, but it does not output in the exact 'YYYY-MM-DD HH:MM:SS' format without additional parsing.

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

date '+%Y-%m-%d %H:%M:%S'

The `date` command with the format string `'+%Y-%m-%d %H:%M:%S'` explicitly outputs the current date and time in the requested 'YYYY-MM-DD HH:MM:SS' format. Option D (`date -Iseconds`) outputs date and time in ISO 8601 format (e.g., 2023-10-05T14:30:00+00:00) with a 'T' separator and timezone, not the requested format. Therefore, only option A is correct.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • date '+%Y-%m-%d %H:%M:%S'

    Why this is correct

    Formats date as required.

  • cal

    Why it's wrong here

    Shows calendar, not current date/time.

  • timedatectl

    Why it's wrong here

    Shows time and date but not in that exact format.

  • date -Iseconds

    Why it's wrong here

    date -Iseconds outputs date and time in ISO 8601 format (e.g., 2023-10-05T14:30:00+00:00) with a 'T' separator and timezone, not the requested 'YYYY-MM-DD HH:MM:SS' format.

  • hwclock

    Why it's wrong here

    Displays hardware clock, not current date/time.

About these practice questions

Courseiva writes every EX200 question from scratch — 127 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

JA

Written by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

This EX200 practice question is part of Courseiva's free Red Hat certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the EX200 exam.