cal [[month] year]

Show a calendar

Displays a calendar.
Sample Output
$ cal april 2009
     April 2009
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

0
By: raphink
2009-02-16 15:33:46
cal

These Might Interest You

  • Contrary to logic, typing calendar won't show a calendar, that's the job of cal. Typing calendar will show some trivia related to the current date. Tested against many Linux distros and FreeBSD. Show Sample Output


    6
    calendar
    vlan7 · 2010-01-29 11:17:11 3
  • The cal command is handy, but sometimes you want to quickly see today's date highlighted. That's why I came up with this quick command. Much like http://www.commandlinefu.com/commands/view/1342/show-this-months-calendar-with-todays-date-highlighted but cleaner and more succinct. Show Sample Output


    3
    cal | grep -E --color "\b`date +%e`\b|$"
    donjuanica · 2012-06-27 20:30:40 0
  • Show today date on a yearly calendar.


    -1
    cal -y
    andrepuel · 2009-09-02 12:57:23 0
  • Using the gcalcli interface to google calendar, print the calendar for the next 2 weeks according to the width of the terminal being used. * Remove "--mon" to start week on sunday, * Change 2 for more or less weeks gcalcli --mon --width $((COLUMNS/8)) calm for whole month Show Sample Output


    0
    gcalcli --mon --width $((COLUMNS/8)) calw 2
    jaw42 · 2013-07-04 12:28:51 0
  • Explanation: * The date command evaluated to today's date with blank padded on the left if single digit * The grep command search and highlight today's date * The --before-context and --after-context flags displays up to 6 lines before and after the line containing today's date; thus completes the calendar. I have tested this command on Mac OS X Leopard and Xubuntu 8.10


    4
    cal | grep --before-context 6 --after-context 6 --color -e " $(date +%e)" -e "^$(date +%e)"
    haivu · 2009-03-04 06:46:52 4
  • Add calendar to desktop wallpaper , mess with the coordinates to place where you like


    15
    convert -font -misc-fixed-*-*-*-*-*-*-*-*-*-*-*-* -fill black -draw "text 270,260 \" `cal` \"" testpic.jpg newtestpic.jpg
    dasmna · 2009-03-16 16:09:58 3

What do you think?

Any thoughts on this command? Does it work on your machine? Can you do the same thing with only 14 characters?

You must be signed in to comment.

What's this?

commandlinefu.com is the place to record those command-line gems that you return to again and again. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.

Share Your Commands



Stay in the loop…

Follow the Tweets.

Every new command is wrapped in a tweet and posted to Twitter. Following the stream is a great way of staying abreast of the latest commands. For the more discerning, there are Twitter accounts for commands that get a minimum of 3 and 10 votes - that way only the great commands get tweeted.

» http://twitter.com/commandlinefu
» http://twitter.com/commandlinefu3
» http://twitter.com/commandlinefu10

Subscribe to the feeds.

Use your favourite RSS aggregator to stay in touch with the latest commands. There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,…):

Subscribe to the feed for: