The CAL command can be used to display a Gregorian calendar. The Gregorian calendar is now the International Universal Calendar, also known as Griel, the Gregorian calendar. "Solar" is also known as "solar Calendar", the earth around the sun for one year, for the western countries are universal, it is also known as "Western Calendar".
1. Command format:
Cal [parameters] [month] [year]
2. Command function:
Used to view time information such as a calendar, such as a single argument, that represents the year (1-9999), and if there are two parameters, the month and year
3. Command parameters:
-1 shows the one month calendar
-3 Display system first one months, current month, next one month calendar
-S displays Sunday for the first day of one weeks, the default format
-M displays Monday for the first day of one weeks
-J Displays the day of the Year in the year (the date of the month is counted, from January 1, and the number of days in the year is displayed by default)
-y Displays the calendar for the current year
4. Usage examples:
Example 1: Display the current month calendar
Command:
Aa.
Output:
[[email protected] ~]# cal
December on 2012
Day 123456
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
31[[email protected] ~]#
Example 2: Display a calendar for a specified month
Command:
Cal 9 2012
Output:
[[email protected] ~]# Cal 9 2012
September on 2012
Day 123456
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
Example 3: Displaying the 2013 calendar
Command:
Cal-y 2013
Cal 2013
Output:
Example 4: Displays the number of days since January 1
Command:
Cal-j
Output:
[Email protected] ~]# cal-j
December on 2012
Day 123456
336
337 338 339 340 341 342 343
344 345 346 347 348 349 350
351 352 353 354 355 356 357
358 359 360 361 362 363 364
365 366[[email protected] ~]#
Example 5: Monday shown in the first column
Command:
Cal-m
Output:
[Email protected] ~]# cal-m
December on 2012
123456 days
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
Linux command (+): Cal command