9
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. ?

14

From man date:

%a     locale's abbreviated weekday name (e.g., Sun)
  • 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 – theonlygusti Jan 6 at 15:49
  • 2
    FWIW you might see the full list detailed in the man page for strftime, the system call which date makes use of. – steve Jan 6 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 – theonlygusti Jan 6 at 16:25
  • 1
    To be pedantic, strftime is a library call (in section 3 of the manual) not a system call. – icarus Jan 6 at 17:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.