Display calendar with specific national holidays and week numbers

gcal -K -q GB_EN 2009 # display holidays in UK/England for 2009 (with week numbers)
NB when you run this gcal command in your shell, holidays are highlighted but this highlighting does not show in the sample output (above). To find full details on gcal options: gcal --long-help | less Example for United States, Pennsylvania: gcal -K -q US_PA 2009 # display holidays in USA/Pennsylvania for 2009 (with week numbers) Example for Hong Kong: gcal -K -q HK 2009 # display holidays in Hong Kong for 2009 (with week numbers)
Sample Output
2009


      January                   February                   March
 Su Mo Tu We Th Fr Sa CW   Su Mo Tu We Th Fr Sa CW   Su Mo Tu We Th Fr Sa CW
              1  2  3 52    1  2  3  4  5  6  7 05    1  2  3  4  5  6  7 09
  4  5  6  7  8  9 10 01    8  9 10 11 12 13 14 06    8  9 10 11 12 13 14 10
 11 12 13 14 15 16 17 02   15 16 17 18 19 20 21 07   15 16 17 18 19 20 21 11
 18 19 20 21 22 23 24 03   22 23 24 25 26 27 28 08   22 23 24 25 26 27 28 12
 25 26 27 28 29 30 31 04                             29 30 31             13
                                                                            


       April                      May                       June
 Su Mo Tu We Th Fr Sa CW   Su Mo Tu We Th Fr Sa CW   Su Mo Tu We Th Fr Sa CW
           1  2  3  4 13                   1  2 17       1  2  3  4  5  6 22
  5  6  7  8  9 10 11 14    3  4  5  6  7  8  9 18    7  8  9 10 11 12 13 23
 12 13 14 15 16 17 18 15   10 11 12 13 14 15 16 19   14 15 16 17 18 19 20 24
 19 20 21 22 23 24 25 16   17 18 19 20 21 22 23 20   21 22 23 24 25 26 27 25
 26 27 28 29 30       17   24 25 26 27 28 29 30 21   28 29 30             26
                           31                   22                          
[truncated for brevity]

5
By: mpb
2009-03-15 10:19:52

These Might Interest You

  • Display the holidays in December and January for UK/England (2012/2013). Most Linux distros have "gcal" in their package manager system. If not, it is available here: http://www.gnu.org/software/gcal Show Sample Output


    0
    gcal -K -q GB_EN December/2012-January/2013 # Holidays for Dec/2012 and Jan/2013 with week numbers
    mpb · 2012-11-07 18:01:31 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
  • 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
  • Displays a calendar. Show Sample Output


    0
    cal [[month] year]
    raphink · 2009-02-16 15:33:46 0

What Others Think

If you do not have the gcal command it can easily be installed. For example, on Mandriva Linux: urpmi gcal
mpb · 483 weeks and 5 days ago
Doesn't seem to exist in macports, however the similar tool 'pal' is available on that platform. Nice to see some updates to cal!
philiph · 483 weeks and 3 days ago

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: