cal - Display a calendar for a month or year

Format

cal [month ] [year]

Description

cal displays a calendar on standard output (stdout).
  • With no arguments, cal displays a calendar for the current month of the current year.
  • If one argument is given and it is numeric, cal interprets it as a year (for example, 1991). If a single argument is not numeric, cal interprets it as the name of a month, possibly abbreviated (for example, apr).
  • If two arguments are given, cal assumes that the first argument is the month (either a number in the range 1 - 12 or a month name) and the second is the year.

Localization

cal uses the following localization environment variables:
  • LANG
  • LC_ALL
  • LC_MESSAGES
  • NLSPATH

Usage notes

Year numbers that are less than 100 refer to the early Christian era, not the current century. This command prints the Gregorian calendar, handling September 1752 correctly. Many cultures observe other calendars.

Exit values

0
Successful completion.
1
Failure due to any of the following reasons:
  • An incorrect command-line argument.
  • An incorrect date.
  • A year outside the range 1 - 9999 A.D.

Portability

X/Open Portability Guide, UNIX systems.