0

With the cal command I noticed you can use:

cal -3

Which displays current month, one before, and one behind. Is there an easy way to show another number? The following doesn't work:

cal -5

Are the only options single month, 3 months, or full year? Or is there a simple way to show an amount of months above 3 but below 12?

1

I hate to answer my own question. It was so obvious after reading man cal.

cal -A 4

The above displays 5 months, but not in the same way cal -3 does (with current month in the middle). Instead it starts with the current month and adds 4 ahead.

  • cal -B2 -A2 should give you 5 months with the current month in the middle – steeldriver Jan 14 '17 at 23:48
  • 1
    This is true for a specific implementation of cal, not for all cals (but which?). – Michael Homer Jan 15 '17 at 0:07
  • @MichaelHomer I had no idea there were different versions. I'm using ubuntu. – Philip Kirkbride Jan 15 '17 at 0:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.