Command “cal” stands for calendar.
This command is used to see the calendar of a specific month/ year or both.
The basic syntax of command “cal”.
1 | cal [month] [year] |
[month]- is used for specify month
[year] – is used for specify year
cal command to display calendar of current month
type “cal” command on terminal and press enter and output will be calendar of the current month
1 | $ cal [ type “cal” on terminal and press enter] |
Output:
1 2 3 4 5 6 7 | January 2018 Mo Tu Th We Fr Sa So 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 25 27 28 29 30 31 |
To see the calendar of specific month/Year [for example May 2021]
type below command in terminal.
1 | $ cal 05 2021 [ press enter] |
Output:
1 2 3 4 5 6 7 8 | May 2021 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 |
To see the calendar of the specific year (all 12 months)
To see the calendar of the year 2012. Type “cal” command and attach desired year as shown below
1 | $ cal 2021 [ press enter] |
Output
In output calendar of 2012(all 12 months) will display in the terminal.
Display the calander for current year
1 | $ cal -y [ press enter] |
Q: Display the previous, current and next month calendar of the year 1987 August
1 | $ cal -3 8 1987 [ press enter] |

Q: write a command to display the previous, current and next month calendar of the year 2015 december.
1 | $ cal -3 12 2015 [ press enter] |
Q: What is the command to display the days of the year 2016
1 | $ cal 2016 [ press enter] |
Read More
Linux and Unix rm command tutorial with examples
Linux and Unix mv command tutorial with examples
Linux and Unix tail command tutorial with examples
Reference