Showing posts with label command to display previous and next calender of current month. Show all posts
Showing posts with label command to display previous and next calender of current month. Show all posts

Monday, February 14, 2011

cal linux command

Cal command displays a simple calendar.  If arguments are not specified, the current month is displayed.



Syntax :


     cal [options] [[month] year]


cal Options :


     The options of cal command are as follows:


     -1      Display single month output.  (This is the default.)


     -3      Display previous, current and next month output.


     -s      Display Sunday as the first day of the week.  (This is the default.)


     -m      Display Monday as the first day of the week.


     -j      Display Julian dates (days one-based, numbered from January 1).


     -y      Display a calendar for the current year.


Examples :


1) cal 2012
This example gives the calendar of the year 2012.
2) cal -3 9 2011
This example gives an output calendar of one month before and after September 2011.
3) cal 6 2011
It will gives the calender of june 2011.