/usr/share/calendar

Paul Bissex shares a curious feature installed with OS X while writing a script. Open a Terminal and type -

cat /usr/share/calendar/* | grep `date +"%m/%d"`

Turns out /usr/share/calendar is full of historical date information, for which use I have no idea. Kinda fun though...

/usr/share/calendar screenshot

Posted 6 years, 4 months ago on 24th September 2003.


Comments

Nice. :)

You can make it a little easier on yourself by adding the following line to your ~/.tcshrc file.

alias today "cat /usr/share/calendar/* | grep `date +"%m/%d"`;"

Restart the Terminal application then you just need to type "today" from now on. ;)

Tommy · 6 years, 4 months ago


Good tip Tommy. I did a bit of Googling and it seems you can sort the calendar by it’s categories too, e.g :

cat /usr/share/calendar/calendar.computers
cat /usr/share/calendar/calendar.music
cat /usr/share/calendar/calendar.history

Phil · 6 years, 4 months ago


Cool! I added this to .bashrc so I see it every time I open a new terminal window :-)

Gabriel Radic · www · 6 years, 4 months ago


Standard BSDishness would suggest that you’ve got a "calendar" program installed somewhere to do this for you. Try /usr/bin/calendar or /usr/games/calendar

Scott James Remnant · 6 years, 4 months ago


Mac OS X 10.3 Panther seems to break this a bit. It’s coming back with some "Operation not permitted" errors, although, it still works.

Cedric · www · 6 years, 3 months ago


Same problem here Cedric. I get these errors in Panther -

cat: /usr/share/calendar/de_DE.ISO8859-1: Operation not permitted
cat: /usr/share/calendar/fr_FR.ISO8859-1: Operation not permitted
cat: /usr/share/calendar/hr_HR.ISO8859-2: Operation not permitted
cat: /usr/share/calendar/ru_RU.KOI8-R: Operation not permitted

I’m not sure why this is so yet - a bit of googling required methinks...

Phil · 6 years, 3 months ago


In Panther the line should be -

cat /usr/share/calendar/calendar.* | grep `date +"%m/%d"`

Courtesy of a comment in this post on nslog() -
http://nslog.com/archives/2003/09/20/usrsharecalendar.php

Phil · 6 years, 3 months ago


The files in /usr/share/calendar should be used in conjunction with the calendar utility. Type ‘man calendar’ to see what I mean. Further, I would create a directory under your home directory called ".calendar" and put a file in it called "calendar" and fill it with entries as per the instructions in ‘man calendar’.

Here is my ~/.calendar/calendar file:

#include <calendar.world>
#include <calendar.usholiday>
#include <calendar.birthday>
#include <calendar.computer>
#include <calendar.freebsd>
#include <calendar.history>
#include <calendar.holiday>
#include <calendar.music>

Paul Smith · 6 years ago


Thanks for the comments Paul. I’ve changed the filter to correctly display html entities rather than stripping them out, so your original comment displays okay. I’ve removed your other 2 comments ;-)

Phil · www · 6 years ago


Just a (late) note. The "operation not permitted" messages above are due to the fact that those four items are directories, not files.

Nkuvu · 5 years, 7 months ago


LOL, this comes up today:

08/12 Joe Marcus Clarke <marcus@FreeBSD.org> born in Lakeland, Florida, United States, 1976

Wonder who it is? I sent an apple ecard for kicks. Wonder how many he gets????

Geek Grrrl · 5 years, 6 months ago


« back to Mac OS X

Skip Navigation