prettier "cal" command

cal |grep -A7 -B7 --color=auto $(date +%d)
Displays the same output as "cal", but with the current day highlighted (probably dependent on gnu grep, as I'm not sure other grep's support the "--color=auto" option). Tested and working on Ubuntu 11 and OSX Lion.
Sample Output
   November 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

6
2011-11-26 22:13:12

1 Alternatives + Submit Alt

What Others Think

Thanks for the downvotes, I guess? Can't imagine why anyone would not like this.
4fthawaiian · 364 weeks and 2 days ago
It could be because cal already highlights the current day on modern systems.
Fudo · 364 weeks and 1 day ago
Interesting. I see that you're right - ubuntu doesn't need it, for example. It still works, though ;)
4fthawaiian · 364 weeks and 1 day ago
It highlighted 2011 today for me - the year.
0leg · 363 weeks and 5 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: