TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Cal – Display a Calendar in Your Terminal

160 点作者 adius大约 9 年前

23 条评论

jefftk大约 9 年前
Just don&#x27;t try to use two digit format for years:<p><pre><code> ~ $ cal 5 16 May 16 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 ~ $ cal 5 2016 May 2016 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</code></pre>
评论 #11678708 未加载
评论 #11678138 未加载
评论 #11682054 未加载
wyc大约 9 年前
Another useful command line service I use almost daily (using a rather wide terminal):<p><pre><code> $ curl wttr.in&#x2F;94035 </code></pre> My most frequently used option for cal on GNU&#x2F;Linux is &quot;-3&quot;. It shows the current, previous, and next month with the current day highlighted, which are usually all the information I need.<p><pre><code> $ cal -3 April 2016 May 2016 June 2016 Su Mo Tu We Th Fr Sa Su Mo Tu We Th Fr Sa Su Mo Tu We Th Fr Sa 1 2 1 2 3 4 5 6 7 1 2 3 4 3 4 5 6 7 8 9 8 9 10 11 12 13 14 5 6 7 8 9 10 11 10 11 12 13 14 15 16 15 16 17 18 19 20 21 12 13 14 15 16 17 18 17 18 19 20 21 22 23 22 23 24 25 26 27 28 19 20 21 22 23 24 25 24 25 26 27 28 29 30 29 30 31 26 27 28 29 30</code></pre>
评论 #11678007 未加载
评论 #11680948 未加载
JoshTriplett大约 9 年前
A really fun detail in cal:<p><pre><code> ~$ cal 9 1752 September 1752 Su Mo Tu We Th Fr Sa 1 2 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30</code></pre>
评论 #11677982 未加载
评论 #11678536 未加载
ams6110大约 9 年前
FTA: <i>I’d be really excited to hear all the use cases for gcal one can come up with. Seems really suited for a TODO list manager or to never forget a birthday again.</i><p><pre><code> $ man calendar CALENDAR(1) General Commands Manual CALENDAR(1) NAME calendar - reminder service SYNOPSIS calendar [-abw] [-A num] [-B num] [-f calendarfile] [-t [[[cc]yy]mm]dd] DESCRIPTION The calendar utility checks the current directory or the directory specified by the CALENDAR_DIR environment variable for a file named calendar and displays lines that begin with either today&#x27;s date or tomorrow&#x27;s. On Fridays, events on Friday through Monday are displayed. [...]</code></pre>
评论 #11681406 未加载
评论 #11686679 未加载
mcphage大约 9 年前
On OSX at least, if you run it as CAL instead of cal you get a sideways calendar:<p><pre><code> mcphage:~ $ CAL May 2016 Mo 2 9 16 23 30 Tu 3 10 17 24 31 We 4 11 18 25 Th 5 12 19 26 Fr 6 13 20 27 Sa 7 14 21 28 Su 1 8 15 22 29</code></pre>
评论 #11680939 未加载
评论 #11680826 未加载
geodel大约 9 年前
I love this original responsive and flat UI calendar and use it all the time.
snorkel大约 9 年前
Good ol cal! Circa 1998 my first homebrew web ui date picker input was just cal output redressed with html links ... And we were thankful for what we had!
geofft大约 9 年前
Huh, despite being the &quot;GNU&quot; calendar program, gcal is in fact generally named gcal on GNU&#x2F;Linux. On my Debian GNU&#x2F;Linux machine, &#x2F;usr&#x2F;bin&#x2F;cal is from bsdmainutils, and gcal is in its own package (as with Homebrew).
res0nat0r大约 9 年前
gcal highlighting the current date and &#x27;.&#x27; are nice features for me.<p><pre><code> $ brew info gcal gcal: stable 4 (bottled) Program for calculating and printing calendars https:&#x2F;&#x2F;www.gnu.org&#x2F;software&#x2F;gcal&#x2F; &#x2F;usr&#x2F;local&#x2F;Cellar&#x2F;gcal&#x2F;4 (81 files, 2.8M) * Poured from bottle on 2016-01-13 at 17:03:09 From: https:&#x2F;&#x2F;github.com&#x2F;Homebrew&#x2F;homebrew-core&#x2F;blob&#x2F;master&#x2F;Formula&#x2F;gcal.rb ==&gt; Dependencies Build: xz 2016 April May June Su Mo Tu We Th Fr Sa Su Mo Tu We Th Fr Sa Su Mo Tu We Th Fr Sa 1 2 1 2 3 4 5 6 7 1 2 3 4 3 4 5 6 7 8 9 8 9 10&lt;11&gt;12 13 14 5 6 7 8 9 10 11 10 11 12 13 14 15 16 15 16 17 18 19 20 21 12 13 14 15 16 17 18 17 18 19 20 21 22 23 22 23 24 25 26 27 28 19 20 21 22 23 24 25 24 25 26 27 28 29 30 29 30 31 26 27 28 29 30</code></pre>
gerbilly大约 9 年前
I once used cal as input to another program in the old days when there weren&#x27;t many calendar APIs in C yet.<p>The program produced TeX output so I could print a nice wall calendar (complete with tasks and birthdays).<p>Was kind of klunky, but it worked.
sasvari大约 9 年前
also noteworthy: khal [0], a CLI calendar program which syncs to CalDAV servers with vdirsyncer [1].<p>[0] <a href="https:&#x2F;&#x2F;github.com&#x2F;pimutils&#x2F;khal" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;pimutils&#x2F;khal</a><p>[1] <a href="https:&#x2F;&#x2F;github.com&#x2F;pimutils&#x2F;vdirsyncer" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;pimutils&#x2F;vdirsyncer</a>
评论 #11680844 未加载
sgt大约 9 年前
I use &#x27;cal&#x27; on a daily basis. I don&#x27;t find any other calendar programs to be as convenient and simple to use.
评论 #11678030 未加载
towb大约 9 年前
&quot;cal&quot; is the only calendar on my OS, who needs that other bloat.<p>Try:<p><pre><code> cal -m </code></pre> I even have it aliased to &quot;calm&quot; :-)
评论 #11677784 未加载
评论 #11677887 未加载
oneeyedpigeon大约 9 年前
cal is great, but I <i>never</i> remember it exists. I always (OSX) go up to the menubar datetime, get annoyed that there&#x27;s no kind of simple calendar underneath it (just wrap cal!), then go hunting for Google Calendar. I guess I just don&#x27;t think of that kind of program as a built-in command-line one.
评论 #11680551 未加载
评论 #11681929 未加载
bootload大约 9 年前
love Cal, call a script to use it in my .bashrc to show current date, user, day&#x2F;time, logins and filesystem status.<p><pre><code> clear cal echo &quot;Hey \033[1m$USER\033[0m it&#x27;s \033[1m`date &#x27;+%A %d %B @ %T&#x27;`\033[0m&quot; | tr &#x27;[A-Z]&#x27; &#x27;[a-z]&#x27; echo &quot;logins:\c&quot; ; who | wc -l df -h</code></pre>
评论 #11682202 未加载
adius大约 9 年前
You can check out the follow up post at <a href="http:&#x2F;&#x2F;adriansieber.com&#x2F;fold-wrap-lines-to-fit-in-specified-width&#x2F;" rel="nofollow">http:&#x2F;&#x2F;adriansieber.com&#x2F;fold-wrap-lines-to-fit-in-specified-...</a> =)
ruggeri大约 9 年前
Killer feature of gcal for me is that by default it highlights the current day. Didn&#x27;t know about `gcal .`, which is very convenient to know; I used to do `gcal 2016` if I needed to see prev&#x2F;next months.
eknkc大约 9 年前
I always learn about these stuff, think about using them all the time, then I totally forget until someone posts it again on HN.
jijojv大约 9 年前
no mention of &quot;cal -y&quot; which should have been the default most common use option IMHO.
MikeTLive大约 9 年前
if you really want to go nuts -<p><a href="https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Util-linux" rel="nofollow">https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Util-linux</a><p>read all the pages, explore all the man pages, then experiment and learn.
ams6110大约 9 年前
I use cal almost every day. Way faster than phone or web page calendars.
FajitaNachos大约 9 年前
Wow. Had no idea that existed. Looking forward to more tidbits
评论 #11680509 未加载
评论 #11678883 未加载
Bushra8大约 9 年前
gcal -n --astronomical-holidays
评论 #11709607 未加载
评论 #11678907 未加载