以星期一作为一周的第一天的命令行日历

command line calendar with Monday as the first day of the week

我想知道如何在 Linux/Debian 上使用 cal 命令将星期一显示为一周的第一天而不是星期日。

根据我对 cal 手册页的相应了解

-M      Weeks start on Monday.

但它似乎在我的机器上不起作用:

cal -M
Usage: cal [general options] [-jy] [[month] year]
       cal [general options] [-j] [-m month] [year]
       ncal -C [general options] [-jy] [[month] year]
       ncal -C [general options] [-j] [-m month] [year]
       ncal [general options] [-bhJjpwySM] [-H yyyy-mm-dd] [-s country_code] [-W number of days] [[month] year]
       ncal [general options] [-Jeo] [year]
General options: [-31] [-A months] [-B months] [-d yyyy-mm]

cal 不支持所有 UNIX 版本中的 -M 选项。

或者,您可以使用 ncal -M -b 获得所需的输出。

      May 2022        
Mo Tu We Th Fr Sa Su  
                   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                 

学分:

How to display calendar in terminal with Monday as the start of the week

Unix - Monday as first day