archer72 ,
@archer72@mastodon.sdf.org avatar

alias ds='date +"%Y_%b_%d_%H_%M_%S_%N"'

If a file is made in this way: "ds"
the output will look like this.

ie.
todo_2024_Mar_31_04_23_31_051692831.md

If there is a better way, comments are welcome.

mforester ,
@mforester@rollenspiel.social avatar

@archer72 I kinda like date --iso-8601, which will output '2024-03-31' for today (but of course without the same precision you used).
I find this format much easier to read and it's automatically sorted correctly when you look at a lot of files. 🙂
If I need to be more precise, I usually go with date +%Y-%m-%d-%H%M%S.

  • All
  • Subscribed
  • Moderated
  • Favorites
  • random
  • All magazines