Untitled Document
cal Command

cal command is used to display the calendar for the entire year , current month . Lets see some examples on how cal dispalys calendar based on different options -

1. Basic example -

Run the cal command on your terminal and it will disaply the calendar for the current month

   cal 

2. Same output with an option to cal command

Run cal -1 , you will get same output as above . -1 displays calendar for current month .

   cal -1  

3. Display calendar for previous month ,current mont and next month

Run cal -3 , you will get output as calendar for previous, current and next months . -3 displays calendar for previous, current and next months.

   cal -3  

4. Display the calendar for year - 2015

We can display the calendar for any year using cal command followed by year(yyyy) for which calendar needs to be displayed . Now to display calendar for year -2015 run below command .The command will display calendar for entire year - 2015.

   cal 2015 

5. Display the calendar for the month march and year - 2015

Run the cal command as cal 03(mm) 2015(yyyy). Run the below command to get the required output and this way we can get the calendar for any year and for any month .
   cal 03 2015 
Untitled Document