Introduction:
There are different built-in commands in Linux that are there to serve some very special purposes. One such commands is the βcalβ command that is used to print the calendar on the terminal. The goal of this article is to discuss the different methods in which the βcalβ command can be used on a Linux Mint 20 system.
Method of Using the βcalβ Command in Linux Mint 20:
For learning the usage of the βcalβ command in Linux Mint 20, you will have to proceed with the following examples:
Example # 1: Displaying the Calendar for the Current Month:
You can display the calendar for the current month by using the βcalβ command without any options as shown in the image below:
$ cal
The calendar for the current month with the current date highlighted is shown in the following image:
Example # 2: Another Way of Displaying the Calendar for the Current Month:
There is another way of displaying the calendar for the current month and it is stated below:
$ cal 11 2021
In this command, you will have to mention the current month and year with the βcalβ command. Since the current month is βNovemberβ and the current year is β2021β, that is why we have written β11 2021β in the above-mentioned command.
The calendar for the current month with the current date highlighted is shown in the following image:
Example # 3: Displaying the Calendar for the Current Year:
You can also display the whole calendar for the current year i.e. the calendar for all the months of the ongoing year at once. For that, you will have to execute the command shown below:
$ cal 2021
The calendar for the year 2021 i.e. the current year is shown in the following image:
Example # 4: Displaying the Calendar for any Specific Year:
You can also display the whole calendar for any specific year whether it is previous, next, or current with the help of the βcalβ command by running it in the manner shown below:
$ cal 2014
In this example, we wanted to display the whole calendar for the year 2014 and it is shown in the following image:
Example # 5: Displaying the Calendar for the Previous, Current, and Next Month:
If you just want to display the calendar for the previous, current, and next month of the current year i.e. the calendar for the month of October, November, and December in this case, then you will have to use the βcalβ command in the manner shown below:
$ cal -3
The calendar for the previous, current, and next month with the current date highlighted is shown in the following image:
Example # 6: Displaying the Julian Calendar for the Current Month:
You can even display the Julian calendar for the current month by running the βcalβ command. Julian calendar is the one in which the dates start from 001 and go up till 365 (for the normal years) and 366 (for the leap year). This can be done with the βcalβ command shown below:
$ cal βj
The Julian calendar for the current month with the current date highlighted is shown in the following image:
Conclusion:
In this article, we talked about the six different methods in which the βcalβ command can be used on a Linux Mint 20 system. All of these methods simply imply that the βcalβ command is indeed a very useful Linux command.