Which TWO commands can be used to display the current date and time in a format like '2023-10-05 14:30:00'?
Trap 1: cal
Shows calendar, not current date/time.
Trap 2: timedatectl
Shows time and date but not in that exact format.
Trap 3: date -Iseconds
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.
- A
date '+%Y-%m-%d %H:%M:%S'
Formats date as required.
- B
cal
Why it fails: Shows calendar, not current date/time.
- C
timedatectl
Why it fails: Shows time and date but not in that exact format.
- D
date -Iseconds
Why it fails: 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.
- E
hwclock
Why it fails: Displays hardware clock, not current date/time.