Cal is a terminal command used in Linux to print a calendar. Simply type cal to display the current month calendar.
In this tutorial, we learn about cal command in Linux and its options.
syntax of cal command:
cal [options] [[[day] month] year]
If no arguments are provided the cal command displays the current month calendar with the current date highlighted.
Options of cal command
Let's take a look at the options of cal command and its outputs.The outputs format may vary slightly depending on the Linux distributions you use. Here we are using Ubuntu
01. To show the calendar of a specific month of the year - for example, "September 2021".
cal 09 2021
02. To show calendar for the current whole year with the current date highlighted:
03. You can display the whole calendar for a specific year, type:
04. You can display the calendar of previous, current (along with current date highlighted) and next month, type:
05. If you wish to display the calendar for the current month and next two months, type
cal -A 2
cal -B 2
06. Using cal command you can display the current month in the Julian calendar. Also its highlights the current Julian date.
In this tutorial, we covered cal command in Linux and its options. Thanks for reading.