TrumanWong

cal

Display the current calendar or the calendar for a specified date

Supplementary instructions

cal command is used to display the current calendar, or the calendar of the specified date. If no parameters are specified, the current month is displayed.

A single argument specifies the year (1 - 9999) to be displayed; note that the year must be fully specified: cal 89 will not display a calendar for 1989. Two arguments represent the month (1 - 12) and the year. If no arguments are specified , The calendar for the current month is displayed.

The year begins on Jan 1.

The Gregorian Reformation is thought to have occurred on September 3, 1752. Prior to this date, most countries had recognized the reform (although some did not recognize it until the early 20th century). 10 after that date Days were omitted in this reform, so the calendar for that month was a bit unusual.

grammar

cal [ -mjy ] [ month ] [ year ]

Options

-l # Display output for a single month;
-3 # Display the calendar for the next three months;
-s # Set Sunday as the first day of the month;
-m # Display Monday as the first day of the week.. (Default is Sunday.)
-j # Display the Julian date (number of days based on 1, counting from January 1).
-y # Display the calendar of the current year..

Parameters

Month: Specify the month;
Year: Specify the year.

Example

Executing the cal command alone will print out the calendar:

[root@localhost ~]# cal
     December 2013
day   one two three four five six
  1   2   3   4     5     6   7
  8   9   10  11    12    13  14
 15   16  17  18    19    20  21
 22   23  24  25    26    27  28
 29   30  31