Signup/Sign In
Ask Question
Not satisfied by the Answer? Still looking for a better solution?

Displaying week's number in certain format using ncal or cal

Don't you just love it when two commands each do one thing you want but neither do both?

This is what cal does. Nice formatting. Lacks week numbers though:
$ cal
January 2012
Su Mo Tu We Th Fr Sa
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30 31


This is what ncal does. Weird formatting, but with week numbers:
$ ncal -w
January 2012
Su 1 8 15 22 29
Mo 2 9 16 23 30
Tu 3 10 17 24 31
We 4 11 18 25
Th 5 12 19 26
Fr 6 13 20 27
Sa 7 14 21 28
1 2 3 4 5


The kind of output I want, actually a crossbreed between cal and ncal -w:
by

1 Answer

vishaljlf39
$ ncal -bw
-b Use oldstyle format for ncal output.
-w Print the number of the week below each week column.

Login / Signup to Answer the Question.