Cal command in Linux/Unix
cal command is used in Linux to display the calender for a specific month or for a whole year in the terminal.
Syntax of cal command
cal [Month[Year]]
Installing cal command
Before installing the cal command, you should check whether the cal command is already installed or not. Write cal
in the terminal and hit Enter
cal
sudo apt install ncal
Using cal command
Just using cal command in terminal, will display the current month’s calendar.
cal
Display the current year’s calendar
Use call command with -y option to display the current year’s calender.
cal -y
Displaying any particular month of the current year’s calendar
To display any particular month of the current year, use cal command with -m option followed by month’s name.
cal -m <month'sNamme>
cal -m August
Display any particular month and year’s calendar
cal Month's_in_MM Year'sYYY
cal 11 2022
cal -m Month's_Name Year_in_YYYY
cal -m January 2018
Display whole year’s calendar
cal 2023
Display the previous month, current month and next month’s calender
cal -3
Display the current month’s in Julian’s calendar
cal -j
Display current year in Julian calendar
cal -jy