O'Reilly logo

Linux Pocket Guide, 2nd Edition by Daniel J. Barrett

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Name

cal — stdin  stdout  - file  -- opt  --help  --version

Synopsis

cal [options] [month [year]]

The cal command prints a calendar—by default, the current month:

$ cal
   December 2011
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

To print a different calendar, supply a month and four-digit year: cal 8 2011. If you omit the month (cal 2011), the entire year is printed.

Useful options

-y

Print the current year’s calendar.

-3

Three-month view: print the previous and next month as well.

-j

Number each day by its position in the year; in our example, September 1 would be displayed as 244, September 2 as 245, and so on.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required