Which command option retrieves the date in YYYY-MM-DD format?

Disable ads (and more) with a premium pass for a one time $4.99 payment

Boost your Linux skills with the CompTIA Linux+ Certification Exam simulator. Engage with multiple choice questions and detailed feedback. Master Linux concepts and prepare for your exam with confidence!

The command option that retrieves the date in the YYYY-MM-DD format is indeed the one that specifies the format as a whole. In Linux, when using the date command, the format specifier +%F is a shorthand for %Y-%m-%d. This means that it directly asks the command to output the full date in the desired format: the full year (%Y), followed by the month as a two-digit number (%m), and finally, the day of the month as a two-digit number (%d).

Using +%Y would only display the year, +%d would only show the day, and +%m would only present the month. Therefore, while each of these options retrieves specific parts of a date, +%F is the only option that combines them in the required format of YYYY-MM-DD. This makes +%F the most complete and accurate answer for retrieving the full date in that particular format.

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy