Linux Cal Command Tutorial

37

In Linux and Unix-like systems, the “cal” command is a command-line utility used to print calendars on the terminal. “Cal” is an abbreviated form of Calendar.

It is a pretty simple command and doesn’t contain many options. There are few options to display year, month, or date on the console.

How to Install Cal Utility on Ubuntu 20.04

To install the “cal” command on Linux operating system, launch the terminal and type the following command:

After installing the “cal” command tool in your system, you can use the “cal” command in a terminal. It will show you the current month as depicted in the output image:

Linux Cal Command Tutorial 1617239375 668 Linux Cal Command Tutorial

Cal Commands Options

To display a specific month of the year, follow the syntax:

For example, if I want to print the month of “July 2020,”. I will type it in the following way:

Linux Cal Command Tutorial 1617239375 952 Linux Cal Command Tutorial

You can also display the whole calendar of a specific year in the terminal:

Linux Cal Command Tutorial 1617239376 272 Linux Cal Command Tutorial

To print a calendar of the current year, type:

Linux Cal Command Tutorial 1617239377 17 Linux Cal Command Tutorial

If you want to print the current month with the previous and the next one, use the below-mentioned command:

Linux Cal Command Tutorial 1617239377 49 Linux Cal Command Tutorial

Conclusion

Cal” command is a quite helpful command used to display a calendar on the terminal in Linux and Unix- like systems. The guide has explained to you how to install the “cal” command utility in the Linux system, and it’s working with few examples.

This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish. Accept Read More