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 the one week-j shows the day of the year (the date of the year is counted , from January 1, the number of days in the current month 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
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
[root@localhost ~]#
Example 2: Display a calendar for a specified month
Command:
Cal 9 2012
Output:
[[Email protected] ~] # Cal 9
September
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
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[root@localhost ~]#
Example 5: Monday shown in the first column
Command:
Cal-m
Output:
[[Email protected] ~] # Cal-m
December
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
[root@localhost ~]#
One Linux command per day: Cal command