Detailed explanation of the cal command of the Linux command collection (display calendar)
The cal command can be used to display the Gregorian (Gregorian) calendar. The Gregorian calendar is the current international calendar, also known as the Gregorian calendar, commonly known as the solar calendar. "Gregorian calendar", also known as "solar calendar", is based on the fact that the earth revolves around the sun for one year, which is commonly used by Western countries, so it is also known as "Western calendar". The following Brothers Education (www.lampbrother.net) will give you a detailed explanation (display the calendar)
1. Command format:
cal [parameter] [month] [year]
2. Command function:
used to view the calendar and other time information, such as only one parameter , it means the year (1-9999), if there are two parameters, it means the month and year
3. Command parameters:
-1 Display the monthly calendar of one month -3 Display the monthly calendar of the previous
month, current month and next month of the system-
s displays Sunday as the first day of a week, the default format
-m displays Monday as the first day of a week
-j displays the day of the year (the date of the year is counted by day, from January 1st Starting from the current month, the number of days in the year is displayed by default) -y
displays the calendar of
the current year
December 2012 1234561 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
[root@localhost ~]#
Example 2: Display the calendar of the specified month
Command : cal 9 2012
Output:
Copy the code The code is as follows:
[root@localhost ~]# cal 9 2012
Sep 2012
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: Display 2013 Calendar
Command:
Copy the code The code is as follows:
cal -y 2013
cal 2013
Output:
Example 4: Display the number of days since January 1
Command : cal -j
Output:
Copy the code The code is as follows:
[root@localhost ~]# cal -j
twelve January 2012
day one two three four five six
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 345 Displayed in the first column Command : cal -m Output: Copy code The code is as follows: [root@localhost ~]# cal -m December 2012 1234561 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[root@localhost ~]#
Guess you like
Origin http://43.154.161.224:23101/article/api/json?id=326517042&siteId=291194637
Ranking