mgij-a
Last Updated: February 25, 2016
·
825
· janahrens
7e73bcca5eb4a255d557813cdc5a8174

Command-line calendar with cal

Whenever I want to get a specific date I use cal, the good old unix tool (since UNIX Version 5 and on your current Linux and OSX).

Simply type

$ cal
   November 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

to see the current month and

$ cal 2012

to see the whole year.

Say Thanks
Respond

1 Response
Add your response

1640
Img12766

And if you like to pimp it a little bit just try this:

cal | sed -e '1d' -e '2p;2p;2p;2p' | sed -e '$!N;s/\n/ /' -e '$!N;s/\n/ /' -e '$!N;s/\n/ /' -e '$!N;s/\n/ /' | sed "s/^/ /;s/$/ /;s/ $/ /;s/ $(date +%e) /|$(date +%e)|/"

over 1 year ago ·
Awesome Job

A3e45f3a cade 11e7 83bc 71c9546a2749
Systems Engineer
·
Fulton, Maryland or Remote
·
Full Time