Use the cal command of linux to display the calendar
Do not know how to use the cal command linux calendar display? In fact, it is not difficult to solve this problem. Let Xiaobian take you to learn how to solve it together. I hope you will gain a lot after reading this article.
The cal command takes its name from the English word Calendar. Change the command to display the current calendar, or the Gregorian calendar of the specified date (Gregorian calendar is now the international calendar, also known as Gregorian calendar, commonly known as Gregorian calendar). If there is only one parameter, it represents the year (1-9999), and if there are two parameters, it represents the month and year.
Syntax format: cal [parameter] [month] [year]
Common parameters:
-l Single Month Minute Output Calendar-3 Display calendar of last three months-s Set Sunday as first day of month-m Set Monday as first day of month-j Display day of year (Julian Day)-y Display calendar of year
Reference Example
Calendar showing current month:
[root@linuxcool ~]# cal
April 2019
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
Calendar showing the last three months (current month, previous month and next month):
[root@linuxcool ~]# cal -3
March 2019 April 2019 May 2019
Day one, two, three, four, five, six, one, two, three, four, five, six, one, two, three, four, five, six.
1 2 1 2 3 4 5 6 1 2 3 4
3 4 5 6 7 8 9 7 8 9 10 11 12 13 5 6 7 8 9 10 11
10 11 12 13 14 15 16 14 15 16 17 18 19 20 12 13 14 15 16 17 18
17 18 19 20 21 22 23 21 22 23 24 25 26 27 19 20 21 22 23 24 25
24 25 26 27 28 29 30 28 29 30 26 27 28 29 30 31
31
Calendar showing the specified year and month, such as calendar showing February 2020:
[root@linuxcool ~]# cal 2 2020
February 2020
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 Thank you for reading this article carefully, hope Xiaobian share the use of linux cal command display calendar content is helpful to everyone, but also hope that everyone more support, pay attention to industry information channels, encounter problems to find, detailed solutions waiting for you to learn!