{
    "mode": "man",
    "parameter": "CAL",
    "section": "1",
    "url": "https://www.chedong.com/phpMan.php/man/CAL/1/json",
    "generated": "2026-10-22T12:35:56Z",
    "synopsis": "cal [-3hjy] [-A number] [-B number] [[month] year]\ncal [-3hj] [-A number] [-B number] -m month [year]\nncal [-3bhjJpwySM] [-A number] [-B number] [-W number] [-s countrycode] [[month] year]\nncal [-Jeo] [-A number] [-B number] [year]\nncal [-CN] [-H yyyy-mm-dd] [-d yyyy-mm]",
    "sections": {
        "NAME": {
            "content": "cal, ncal — displays a calendar and the date of Easter\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "cal [-3hjy] [-A number] [-B number] [[month] year]\ncal [-3hj] [-A number] [-B number] -m month [year]\nncal [-3bhjJpwySM] [-A number] [-B number] [-W number] [-s countrycode] [[month] year]\nncal [-Jeo] [-A number] [-B number] [year]\nncal [-CN] [-H yyyy-mm-dd] [-d yyyy-mm]\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "The  cal utility displays a simple calendar in traditional format and ncal offers an alterna‐\ntive layout, more options and the date of Easter.  The new format is a little cramped but  it\nmakes  a  year fit on a 25x80 terminal.  If arguments are not specified, the current month is\ndisplayed.\n\nThe options are as follows:\n",
            "subsections": [
                {
                    "name": "-h",
                    "content": "",
                    "flag": "-h"
                },
                {
                    "name": "-J       -o",
                    "content": "Easter according to the Julian Calendar.\n",
                    "flag": "-o"
                },
                {
                    "name": "-e",
                    "content": "",
                    "flag": "-e"
                },
                {
                    "name": "-j",
                    "content": "",
                    "flag": "-j"
                },
                {
                    "name": "-m _",
                    "content": "Display  the  specified  month.  If month is specified as a decimal number, appending\n‘f’ or ‘p’ displays the same month of the following or previous year respectively.\n",
                    "flag": "-m"
                },
                {
                    "name": "-o",
                    "content": "",
                    "flag": "-o"
                },
                {
                    "name": "-p",
                    "content": "are  assumed  by  ncal.  The country code as determined from the local environment is\nmarked with an asterisk.\n",
                    "flag": "-p"
                },
                {
                    "name": "-s _",
                    "content": "Assume the switch from Julian to Gregorian Calendar at the date associated  with  the\ncountrycode.   If  not specified, ncal tries to guess the switch date from the local\nenvironment or falls back to September 2, 1752.  This was when Great Britain and  her\ncolonies switched to the Gregorian Calendar.\n",
                    "flag": "-s"
                },
                {
                    "name": "-w",
                    "content": "",
                    "flag": "-w"
                },
                {
                    "name": "-y",
                    "content": "month are specified on the command line.\n",
                    "flag": "-y"
                },
                {
                    "name": "-3",
                    "content": "",
                    "flag": "-3"
                },
                {
                    "name": "-1",
                    "content": "",
                    "flag": "-1"
                },
                {
                    "name": "-A _",
                    "content": "Months to add after. The specified number of months is added to the end of  the  dis‐\nplay.  This  is  in addition to any date range selected by the -y, -3, or -1 options.\nFor example, “cal -y -B2 -A2” shows everything from November of the previous year  to\nFebruary of the following year. Negative numbers are allowed, in which case the spec‐\nified number of months is subtracted. For example, “cal -y -B-6” shows July to Decem‐\nber. And “cal -A11” simply shows the next 12 months.\n",
                    "flag": "-A"
                },
                {
                    "name": "-B _",
                    "content": "Months to add before. The specified number of months is added to the beginning of the\ndisplay. See -A for examples.\n",
                    "flag": "-B"
                },
                {
                    "name": "-C       -b",
                    "content": "",
                    "flag": "-b"
                },
                {
                    "name": "-d _",
                    "content": "Use yyyy-mm as the current date (for debugging of date selection).\n",
                    "flag": "-d"
                },
                {
                    "name": "-H _",
                    "content": "Use yyyy-mm-dd as the current date (for debugging of highlighting).\n",
                    "flag": "-H"
                },
                {
                    "name": "-M",
                    "content": "",
                    "flag": "-M"
                },
                {
                    "name": "-S",
                    "content": "",
                    "flag": "-S"
                },
                {
                    "name": "-W _",
                    "content": "First week of the year has at least number days.\n",
                    "flag": "-W"
                },
                {
                    "name": "-b",
                    "content": "A  single  parameter specifies the year (1–9999) to be displayed; note the year must be fully\nspecified: “cal 89” will not display a calendar for 1989.  Two parameters  denote  the  month\nand  year;  the  month  is either a number between 1 and 12, or a full or abbreviated name as\nspecified by the current locale.  Month and year default to those of the current system clock\nand time zone (so “cal -m 8” will display a calendar for the month of August in  the  current\nyear).\n\nNot  all  options  can be used together.  For example the options -y, -3, and -1 are mutually\nexclusive. If inconsistent options are given, the later ones take precedence over the earlier\nones.\n\nA year starts on January 1.\n\nHighlighting of dates is disabled if stdout is not a tty.\n",
                    "flag": "-b"
                }
            ]
        },
        "SEE ALSO": {
            "content": "calendar(3), strftime(3)\n",
            "subsections": []
        },
        "STANDARDS": {
            "content": "The cal utility is compliant with the  X/Open  System  Interfaces  option  of  the  IEEE  Std\n1003.1-2008 (“POSIX.1”) specification.\n\nThe  flags  [-3hyJeopw], as well as the ability to specify a month name as a single argument,\nare extensions to that specification.\n\nThe week number computed by -w is compliant with the ISO 8601 specification.\n",
            "subsections": []
        },
        "HISTORY": {
            "content": "A cal command appeared in Version 1 AT&T UNIX.  The ncal command appeared in  FreeBSD  2.2.6.\nThe  output  of the cal command is supposed to be bit for bit compatible to the original Unix\ncal command, because its output is processed by other programs like CGI scripts, that  should\nnot be broken. Therefore it will always output 8 lines, even if only 7 contain data. This ex‐\ntra blank line also appears with the original cal command, at least on Solaris 8\n",
            "subsections": []
        },
        "AUTHORS": {
            "content": "The ncal command and manual were written by Wolfgang Helbig <helbig@FreeBSD.org>.\n",
            "subsections": []
        },
        "BUGS": {
            "content": "The assignment of Julian–Gregorian switching dates to country codes is historically naive for\nmany countries.\n\nNot all options are compatible and using them in different orders will give varying results.\n\nIt is not possible to display Monday as the first day of the week with cal.\n\nDebian                                      March 7, 2019                                     CAL(1)",
            "subsections": []
        }
    },
    "summary": "cal, ncal — displays a calendar and the date of Easter",
    "flags": [
        {
            "flag": "-h",
            "long": null,
            "arg": null,
            "description": ""
        },
        {
            "flag": "-o",
            "long": null,
            "arg": null,
            "description": "Easter according to the Julian Calendar."
        },
        {
            "flag": "-e",
            "long": null,
            "arg": null,
            "description": ""
        },
        {
            "flag": "-j",
            "long": null,
            "arg": null,
            "description": ""
        },
        {
            "flag": "-m",
            "long": null,
            "arg": null,
            "description": "Display the specified month. If month is specified as a decimal number, appending ‘f’ or ‘p’ displays the same month of the following or previous year respectively."
        },
        {
            "flag": "-o",
            "long": null,
            "arg": null,
            "description": ""
        },
        {
            "flag": "-p",
            "long": null,
            "arg": null,
            "description": "are assumed by ncal. The country code as determined from the local environment is marked with an asterisk."
        },
        {
            "flag": "-s",
            "long": null,
            "arg": null,
            "description": "Assume the switch from Julian to Gregorian Calendar at the date associated with the countrycode. If not specified, ncal tries to guess the switch date from the local environment or falls back to September 2, 1752. This was when Great Britain and her colonies switched to the Gregorian Calendar."
        },
        {
            "flag": "-w",
            "long": null,
            "arg": null,
            "description": ""
        },
        {
            "flag": "-y",
            "long": null,
            "arg": null,
            "description": "month are specified on the command line."
        },
        {
            "flag": "-3",
            "long": null,
            "arg": null,
            "description": ""
        },
        {
            "flag": "-1",
            "long": null,
            "arg": null,
            "description": ""
        },
        {
            "flag": "-A",
            "long": null,
            "arg": null,
            "description": "Months to add after. The specified number of months is added to the end of the dis‐ play. This is in addition to any date range selected by the -y, -3, or -1 options. For example, “cal -y -B2 -A2” shows everything from November of the previous year to February of the following year. Negative numbers are allowed, in which case the spec‐ ified number of months is subtracted. For example, “cal -y -B-6” shows July to Decem‐ ber. And “cal -A11” simply shows the next 12 months."
        },
        {
            "flag": "-B",
            "long": null,
            "arg": null,
            "description": "Months to add before. The specified number of months is added to the beginning of the display. See -A for examples."
        },
        {
            "flag": "-b",
            "long": null,
            "arg": null,
            "description": ""
        },
        {
            "flag": "-d",
            "long": null,
            "arg": null,
            "description": "Use yyyy-mm as the current date (for debugging of date selection)."
        },
        {
            "flag": "-H",
            "long": null,
            "arg": null,
            "description": "Use yyyy-mm-dd as the current date (for debugging of highlighting)."
        },
        {
            "flag": "-M",
            "long": null,
            "arg": null,
            "description": ""
        },
        {
            "flag": "-S",
            "long": null,
            "arg": null,
            "description": ""
        },
        {
            "flag": "-W",
            "long": null,
            "arg": null,
            "description": "First week of the year has at least number days."
        },
        {
            "flag": "-b",
            "long": null,
            "arg": null,
            "description": "A single parameter specifies the year (1–9999) to be displayed; note the year must be fully specified: “cal 89” will not display a calendar for 1989. Two parameters denote the month and year; the month is either a number between 1 and 12, or a full or abbreviated name as specified by the current locale. Month and year default to those of the current system clock and time zone (so “cal -m 8” will display a calendar for the month of August in the current year). Not all options can be used together. For example the options -y, -3, and -1 are mutually exclusive. If inconsistent options are given, the later ones take precedence over the earlier ones. A year starts on January 1. Highlighting of dates is disabled if stdout is not a tty."
        }
    ],
    "examples": [],
    "see_also": [
        {
            "name": "calendar",
            "section": "3",
            "url": "https://www.chedong.com/phpMan.php/man/calendar/3/json"
        },
        {
            "name": "strftime",
            "section": "3",
            "url": "https://www.chedong.com/phpMan.php/man/strftime/3/json"
        }
    ],
    "tldr": {
        "source": "official",
        "description": "Display a calendar with the current day highlighted.",
        "examples": [
            {
                "description": "Display a calendar for the current month",
                "command": "cal"
            },
            {
                "description": "Display a calendar for a specific year",
                "command": "cal {{year}}"
            },
            {
                "description": "Display a calendar for a specific month and year",
                "command": "cal {{month}} {{year}}"
            }
        ]
    }
}