How to get the weekday of a day in ubuntu terminal
How do I get the weekday from a date in the ubuntu terminal?
For example I type in: 1990-01-22
, I want to get an output that says for example Thursday if 22th day was a thursday
.
Use %A
:
$ date -d"1990-01-22" "+%A"
Monday
From man date
:
%A locale's full weekday name (e.g., Sunday)