Unix cal command: a key part of my calendaring solution

11 Jan

I noticed both Tim Bray and John Roberts‘ recent ruminations on the perfect calendar solution, and while I don’t have the answer, in thinking about it I realized that I have a quirky calendar-related habit that has stuck with me for over a decade, throughout all my own various experiments with Palm Desktop, Outlook, iCal, etc. On a daily basis, I use the Unix cal command to help schedule my life. I don’t know what I would do without it.

When looking at broad swaths of time (say, a whole year), nothing beats the good ol’ cal command for quickly giving you a lay of the land when you’re making scheduling decisions far in advance (for conferences, vacations, etc.) Just type “cal 2006″ and you’ve got the whole year laid out before you:

Of course, the Unix cal command is a read-only environment, so once I determine whether a particular date works for whatever I’m doing, I have to put my commitment on a writeable calendar somewhere — but I still couldn’t do without my cal.

Anyone else out there do this?

14 Responses to “Unix cal command: a key part of my calendaring solution”

  1. Nicole January 11, 2006 at 1:30 pm #

    Completely guilty of same behavior – still do it on my mac when I’m in the Darwin terminal window too.

  2. paul January 11, 2006 at 9:36 pm #

    Yup. Darn useful thing.

  3. Chris Radcliff January 13, 2006 at 4:13 pm #

    I once inherited a bit of Web code that shelled out to run cal and parsed the result in order to build a calendar page for a given month. I was surprised at how well it worked (and how much code I had to write to do the same thing without shelling out.)

    Calendars are hard, and cal does them well.

  4. Chad Dickerson January 13, 2006 at 4:22 pm #

    Now that you mention it, I’m pretty sure I wrote some code a long time ago that did just that (i.e. the shell out to cal and parsing).

    I’m not a C programmer (and not that interested in become one at this point), but I’m guessing the cal source code is either amazingly elegant or the hack to beat all hacks.

  5. Wayne Goldsmith January 14, 2006 at 2:22 pm #

    I didn’t know the cal command even existed… Never done much in Unix. That’s one reason I read other people’s blogs on a regualr basis!

    Works great in OS X terminal. I noticed that to view 2006 data you need to say cal 07… I had to type cal 06 twice to realize i was looking at ’05 data. This of course makes sense but it did surprise me the first time.

  6. Beach January 19, 2006 at 1:16 am #

    Hey Chad,

    I have this calendar concept rolling around in my head… I’ve been talking with bradley and a ton of others about it. I’d like to run it by you when you have a moment, I’ll ping ya soon.

  7. Tim Converse January 22, 2006 at 11:18 am #

    Yes, guilty too.

    One of the nice things about the Mac’s transformation to Unix under the hood is that it now comes with cal support built in! :)

  8. Tim Converse January 22, 2006 at 11:21 am #

    Wayne – if you’re literally typing ‘cal 07′, then you’re looking at the calendar for 7 A.D.

  9. Heiko Liebfried March 22, 2006 at 9:10 am #

    Cal is very useful. I like it too.
    If you need a cli program for dates and appointments
    you can use ‘when’. Perhaps now you don’t need separate paper calendars anymore.

    http://www.lightandmatter.com/when/when.html

    Another program i can recommend is DevTodo.
    It has nothing to do with calendars, but i find it extremly useful.

    Think of you have to clean up a directory.
    When you enter it – DevTodo can remember you to do it!
    It saves directory dependent todo lists.

    http://swapoff.org/DevTodo

  10. swisswuff April 19, 2006 at 11:10 pm #

    I run GeekTool on OS X. This allows me to run the output of terminal commands as part of the “desktop background”. Also, I disabled all Finder Icons on the desktop background using a utility called “Cocktail”. You can then have some logs to always run on your desktop, and also the output of “cal -y”. I would like to use a more modern version that also has the -m option (my weeks start on Monday), and Apple only includes an 1994 version of the cal command.

  11. Andrew September 14, 2006 at 3:21 pm #

    I do it all the time!

  12. Patrick Logan September 20, 2006 at 12:42 pm #

    Another useful one I use in Ubuntu or it just comes with gnome I think…

    zenity –calendar

    pops up a calendar for the current month but you can click around by month and by year.

  13. Lisa Harrold January 10, 2007 at 5:44 pm #

    Why in AIX does my cal 2007 command only give me my calendar with 2 months across instead of 3. I want it 3 months across. Can anyone help?

  14. J-L September 9, 2010 at 12:14 pm #

    I love the Unix “cal” command. It’s so convenient when I want to check what day of the week a specific day falls on. (I wish there was a Windows equivalent that was just as easy to use.)

    Recently I learned how to mentally calculate the day of the week for any date since 1800. When I come across a date in a book or article I’m reading, I like to figure out the day of the week it falls on, and then use the “cal” command to check my answer.

    (Incidentally, I use John Conway’s “Doomsday Rule” to mentally calculate the day of the week of any given date. If you’re interested in checking it out, you can look up “Doomsday Rule” on Wikipedia.)

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.