|
5 | 5 | <link href="https://learnbyexample.github.io/atom.xml" rel="self" type="application/atom+xml"/>
|
6 | 6 | <link href="https://learnbyexample.github.io"/>
|
7 | 7 | <generator uri="https://www.getzola.org/">Zola</generator>
|
8 |
| - <updated>2025-01-23T00:00:00+00:00</updated> |
| 8 | + <updated>2025-01-28T00:00:00+00:00</updated> |
9 | 9 | <id>https://learnbyexample.github.io/atom.xml</id>
|
10 | 10 | <entry xml:lang="en">
|
11 | 11 | <title>Understanding Python re(gex)? book announcement</title>
|
|
484 | 484 | <entry xml:lang="en">
|
485 | 485 | <title>Basic examples for the Linux date command</title>
|
486 | 486 | <published>2024-07-31T00:00:00+00:00</published>
|
487 |
| - <updated>2024-08-13T00:00:00+00:00</updated> |
| 487 | + <updated>2025-01-28T00:00:00+00:00</updated> |
488 | 488 | <link rel="alternate" href="https://learnbyexample.github.io/mini/linux-date-command-examples/" type="text/html"/>
|
489 | 489 | <id>https://learnbyexample.github.io/mini/linux-date-command-examples/</id>
|
490 | 490 | <content type="html"><p>I rarely ever use the <code>date</code> command, but when I need it I almost always struggle to get the right incantation. So, I'm just going to record such examples in this blog post (and some good to know features).</p>
|
|
497 | 497 | </span><span style="color:#5597d6;">Wednesday </span><span style="color:#b3933a;">31 </span><span style="color:#5597d6;">July </span><span style="color:#b3933a;">2024 03</span><span style="color:#72ab00;">:</span><span style="color:#b3933a;">53</span><span style="color:#72ab00;">:</span><span style="color:#b3933a;">01 </span><span style="color:#5597d6;">PM IST
|
498 | 498 | </span></code></pre>
|
499 | 499 | <p>Instead, I need particular parts in a particular format. For example, to represent the time component in a dynamically constructed filename as part of a shell script.</p>
|
500 |
| -<pre data-lang="ruby" style="background-color:#f5f5f5;color:#1f1f1f;" class="language-ruby "><code class="language-ruby" data-lang="ruby"><span style="color:#7f8989;"># same as: date +%F or date -I |
| 500 | +<pre data-lang="ruby" style="background-color:#f5f5f5;color:#1f1f1f;" class="language-ruby "><code class="language-ruby" data-lang="ruby"><span style="color:#7f8989;"># same as: date +%F or date -I or date --iso-8601 |
501 | 501 | </span><span>$ date </span><span style="color:#72ab00;">+%</span><span style="color:#5597d6;">Y</span><span style="color:#72ab00;">-%</span><span>m</span><span style="color:#72ab00;">-%</span><span>d
|
502 | 502 | </span><span style="color:#b3933a;">2024</span><span style="color:#72ab00;">-</span><span style="color:#b3933a;">07</span><span style="color:#72ab00;">-</span><span style="color:#b3933a;">31
|
503 | 503 | </span><span>
|
|
568 | 568 | <h2 id="resource-links">Resource links</h2>
|
569 | 569 | <ul>
|
570 | 570 | <li><a href="https://www.gnu.org/software/coreutils/manual/coreutils.html#date-invocation">GNU date command manual</a></li>
|
| 571 | +<li><a href="https://www.gnu.org/software/coreutils/manual/coreutils.html#Examples-of-date">&quot;Examples of date&quot; section from the manual</a></li> |
571 | 572 | <li><a href="https://unix.stackexchange.com/questions/tagged/date?tab=Votes">Top voted Q&amp;A on unix.stackexchange for the date command tag</a></li>
|
572 | 573 | </ul>
|
573 | 574 | </content>
|
|
0 commit comments