Tuesday, February 05, 2008

Linux : Displays Calendar

cal [options] [[month] year]


The cal utility displays a calendar for a month or a year.

Arguments

The arguments specify the month and year for which cal displays a calendar. The month is a decimal integer from 1 to 12 and the year is a decimal integer. Without any arguments, cal displays a calendar for the current month. When you specify a single argument, it is taken to be the year.

Options

–j

(Julian) Displays a Julian calendar—a calendar that numbers the days consecutively from January 1 (1) through December 31 (365 or 366).

–m

(Monday) Makes Monday the first day of the week. Without this option, Sunday is the first day of the week.

–y

(year) Displays a calendar for the current year.

–3

(three months) Displays the previous, current, and next months.


Notes

Do not abbreviate the year. The year 05 is not the same as 2005.

Examples

The following command displays a calendar for August 2007:

$ cal 8 2007

August 2007

Su Mo Tu We Th Fr Sa

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


Next is a Julian calendar for 1949 with Monday as the first day of the week:

$ cal -jm 1949

1949

January February

Mon Tue Wed Thu Fri Sat Sun Mon Tue Wed Thu Fri Sat Sun

1 2 32 33 34 35 36 37

3 4 5 6 7 8 9 38 39 40 41 42 43 44

10 11 12 13 14 15 16 45 46 47 48 49 50 51

17 18 19 20 21 22 23 52 53 54 55 56 57 58

24 25 26 27 28 29 30 59

31 ...

No comments: