Guide to Unix/Commands/Information

From Wikibooks, open books for an open world
< Guide to Unix‎ | Commands
Jump to: navigation, search

Implementation of unix command line calendar.


Syntax[edit]

cal [month] [year]


Examples[edit]

  • cal - prints calendar for current month
  • cal -3 - prints out a 3 months (previous, current and next)
  • cal -1 - prints current month (some implementations defaults to printing three months)
  • cal 12 2006 - prints out calendar for December 2006
  • cal 2006 - prints out calendar for the whole year 2006
  • cal -s - set Sunday as a first day of week
  • cal -m - set Monday as a first day of week
  • cal -j - show the day-numbers (starting with January 1st as #1) of this month

Triva[edit]

In September 1752, England finally switched to the Gregorian-calendar (about 100 years later than the rest of Europe). As Unix was developed in "The Colonies", traces of this change can still be found in cal... try:

  • cal 9 1752