Cal Command in Linux


Cal command is a very useful Linux command that is used to access the calendar from the Linux terminal. This command offers different options with which you can tweak its output according to your requirements. In this article, we will try to show you the usage of the Cal command in Linux Mint 21 with the help of different examples.

Usage of the Cal Command in Linux Mint 21:

The usage of the Cal command in Linux Mint 21 is discussed in the following examples:

Example # 1: Using the Cal Command without any Options:

If you want to display the calendar of the current month of the year only, then you have to use the Cal command without any options as shown below:

$ cal

The calendar of the current month is shown in the following image:

Example # 2: Displaying the Complete Calendar of the Current Year:

To display the complete calendar of the current year, you have to execute the command shown below:

$ cal –y

The complete calendar of the current year is shown in the following image:

Cal-Command-Linux

Example # 3: Displaying the Calendar of a Month of a Specific Year:

Now, if you wish to display the calendar of a month of a specific year, then you have to run the Cal command in the manner shown below:

$ cal 09 1993

Here, “09” represents the month and “1993” represents the year whose calendar is to be displayed as shown in the following image:

Cal-Command-Linux

Example # 4: Displaying the Complete Calendar of a Specific Year:

To display the complete calendar of a specific year, you have to run the command shown below:

$ cal 1996

Here, “1996” represents the year whose calendar is to be displayed as shown in the image that follows:

Cal-Command-Linux

Example # 5: Displaying the Calendar of the Previous, Current, and Next Month of the Current Year:

For displaying the calendar of the previous, current, and the next month of the current year, you have to run the command shown below:

$ cal -3

The calendar of the previous, current, and next month of the current year is shown in the following image:

Cal-Command-Linux

Example # 6: Displaying the Julian Calendar of the Current Month of the Current Year:

To display the Julian Calendar of the current month of the current year, you have to execute the command shown below:

$ cal –j

The Julian Calendar for the current month of the current year is shown in the following image:

Cal-Command-Linux

Conclusion:

In this guide, we discussed the usage of the Cal command in Linux Mint 21. By taking a look at all the examples shared in this article, you can quickly learn to use this command in the most effective manner.

Print Friendly, PDF & Email
Categories

1 comment

Add yours

Comments are closed.