13
date +%b

gives me the three-letter abbreviation of the current month name (I found that out online, it's not in my man date nor can I find the answer to this question in my man date).

How do I get the current day name? e.g. Sun, Mon, Tue, etc. ?

1 Answer 1

21

From man date:

%a     locale's abbreviated weekday name (e.g., Sun)
4
  • oh that's not in my man date but it works. When I search abbr in my man page it just shows yy and cc
    – minseong
    Commented Jan 6, 2019 at 15:49
  • 4
    FWIW you might see the full list detailed in the man page for strftime, the system call which date makes use of.
    – steve
    Commented Jan 6, 2019 at 16:17
  • 1
    @steve oh cool, thank you. Indeed %a is replaced by national representation of the abbreviated weekday name. is in my man strftime
    – minseong
    Commented Jan 6, 2019 at 16:25
  • 1
    To be pedantic, strftime is a library call (in section 3 of the manual) not a system call.
    – icarus
    Commented Jan 6, 2019 at 17:36

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .