diff options
author | EuAndreh <eu@euandre.org> | 2025-04-18 02:17:12 -0300 |
---|---|---|
committer | EuAndreh <eu@euandre.org> | 2025-04-18 02:48:42 -0300 |
commit | 020c1e77489b772f854bb3288b9c8d2818a6bf9d (patch) | |
tree | 142aec725a52162a446ea7d947cb4347c9d573c9 /src/content/tils/2020/08/12 | |
parent | Makefile: Remove security.txt.gz (diff) | |
download | euandre.org-020c1e77489b772f854bb3288b9c8d2818a6bf9d.tar.gz euandre.org-020c1e77489b772f854bb3288b9c8d2818a6bf9d.tar.xz |
git mv src/content/* src/content/en/
Diffstat (limited to 'src/content/tils/2020/08/12')
-rw-r--r-- | src/content/tils/2020/08/12/filename-timestamp.adoc | 31 |
1 files changed, 0 insertions, 31 deletions
diff --git a/src/content/tils/2020/08/12/filename-timestamp.adoc b/src/content/tils/2020/08/12/filename-timestamp.adoc deleted file mode 100644 index aa8d63b..0000000 --- a/src/content/tils/2020/08/12/filename-timestamp.adoc +++ /dev/null @@ -1,31 +0,0 @@ -= Simple filename timestamp -:categories: shell - -When writing Jekyll posts or creating log files with dates on them, I usually -struggle with finding a direct way of accomplishing that. There's a simple -solution: `date -I`. - -[source,sh] ----- -./my-program.sh > my-program.$(date -I).log -cp post-template.md _posts/$(date -I)-post-slug.md ----- - -Using this built-in GNU/Linux tool allows you to `touch $(date -I).md` to -readily create a `2020-08-12.md` file. - -I always had to read `man date` or search the web over and over, and after doing -this repeatedly it became clear that both `date -I` and `date -Is` (`s` here -stands for seconds) are the thing that I'm looking for 95% of the time: - -[source,sh] ----- -# inside my-program.sh -echo "Program started at $(date -Is)" -# output is: -# Program started at 2020-08-12T09:04:58-03:00 ----- - -Both date formats are hierarchical, having the bigger time intervals to the -left. This means that you can easily sort them (and even tab-complete them) -with no extra effort or tool required. |