The -A and -B options in the cal command are used to display additional months relative to the specified month.
Options:
-A n: Displaysnmonths after the specified month.-B n: Displaysnmonths before the specified month.
Example:
-
To show the current month and the next two months:
cal -A 2 -
To show the current month and the previous month:
cal -B 1 -
To show a specific month (e.g., April 2026) and the next three months:
cal 4 2026 -A 3
These options help you view a range of months easily. If you have more questions, feel free to ask!
