Shell - Find day of the week

By xngo on January 3, 2020

In Shell script, you can use the date command line utility to find the day of the week. Here is an example showing 2019-01-27 is a Sunday.

$ date -d "2019-01-27" +%A
# Output: Sunday

About the author

Xuan Ngo is the founder of OpenWritings.net. He currently lives in Montreal, Canada. He loves to write about programming and open source subjects.