010-100 · Question #13
You enter the command date +%M. Wat does the output show you?
The correct answer is D. the current minute. The date command uses format specifiers to display specific time components. The %M specifier outputs the current minute.
Question
You enter the command date +%M. Wat does the output show you?
Options
- Athe current year
- Bthe current month
- Cthe current hour
- Dthe current minute
- Ethe current second
How the community answered
(46 responses)- A9% (4)
- C4% (2)
- D85% (39)
- E2% (1)
Why each option
The date command uses format specifiers to display specific time components. The %M specifier outputs the current minute.
The year is represented by %Y (four-digit) or %y (two-digit), not %M.
The month is represented by %m (numeric) or %B (full name), not %M.
The hour is represented by %H (24-hour) or %I (12-hour), not %M.
In the date command, %M is the format specifier for the current minute (00-59). The format string +%M tells date to output only the minute component of the current time, not the full date or other time fields.
The second is represented by %S, not %M.
Concept tested: Linux date command format specifiers
Source: https://man7.org/linux/man-pages/man1/date.1.html
Topics
Community Discussion
No community discussion yet for this question.