Displaying a Calendar

You can write a calendar to standard output by using the cal command.

The Month parameter names the month for which you want the calendar. It can be a number from 1 through 12 for January through December, respectively. If no Month is specified, the cal command defaults to the current month.

The Year parameter names the year for which you want the calendar. Because the cal command can display a calendar for any year from 1 through 9999, type the full year rather than just the last two digits. If no Year is specified, the cal command defaults to the present year.

The following are examples of how to use the cal command:

  1. To display a calendar for February 2002 at your workstation, type:
    cal 2 2002
  2. Press Enter.
  3. To print a calendar for the year 2002, type:
    cal 2002 | qprt
  4. Press Enter.