Skip to content

Instantly share code, notes, and snippets.

@jens-a-e
Created November 8, 2022 16:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jens-a-e/ba2c56729dc5d8c86324019e8c3c0ec3 to your computer and use it in GitHub Desktop.
Save jens-a-e/ba2c56729dc5d8c86324019e8c3c0ec3 to your computer and use it in GitHub Desktop.
This script prefixes every Markdown file in the current directory with the timestamp of its birth.
#!/bin/sh
# This script prefixes every Markdown file in the current directory with the timestamp of its birth.
# Such a prefix is common in file based note taking systems such as digital Zettelkasten.
# Future improvements could check if the timestamp exists to avoid duplication.
for file in *.md; do mv $file $(stat -f %SB-%N -t '%Y%m%d%H%M%S' $file); done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment