Remix.run Logo
zdw a day ago

If you want week numbers in the calendar, you can use `ncal -w` and they'll be the last row. Add a `-3` and you get:

    $ ncal -w3
        July 2025         August 2025       September 2025
    Mo     7 14 21 28        4 11 18 25     1  8 15 22 29
    Tu  1  8 15 22 29        5 12 19 26     2  9 16 23 30
    We  2  9 16 23 30        6 13 20 27     3 10 17 24
    Th  3 10 17 24 31        7 14 21 28     4 11 18 25
    Fr  4 11 18 25        1  8 15 22 29     5 12 19 26
    Sa  5 12 19 26        2  9 16 23 30     6 13 20 27
    Su  6 13 20 27        3 10 17 24 31     7 14 21 28
       27 28 29 30 31    31 32 33 34 35    36 37 38 39 40
JNRowe a day ago | parent [-]

There is also a `-b` flag to get it back in to the shape you'd expect from cal. I find the week column easier to read in that form:

   w| Mo Tu We Th Fr Sa Su
  31|              1  2  3
  32|  4  5  6  7  8  9 10
Perhaps worth noting that ncal's -w is ISO-8601 compliant¹, which may surprise some people around new year as week numbers can reset in December or January.

[Said as someone who aliases cal to "ncal -wb" mostly just to get the correct first day of the week for their locale.]

¹ https://en.wikipedia.org/wiki/ISO_week_date