Skip to content

Instantly share code, notes, and snippets.

@jeremy-code
Created June 9, 2026 03:24
Show Gist options
  • Select an option

  • Save jeremy-code/1b71297cf344fd606b5d8a354df8ad43 to your computer and use it in GitHub Desktop.

Select an option

Save jeremy-code/1b71297cf344fd606b5d8a354df8ad43 to your computer and use it in GitHub Desktop.
Get last accessed/last modified/creation date of file with stat in macOS
TZ=UTC stat -f '%Sa' -t "%Y-%m-%dT%H:%M:%SZ" ./path/to/file.txt # last accessed
TZ=UTC stat -f '%Sm' -t "%Y-%m-%dT%H:%M:%SZ" ./path/to/file.txt # last modified
TZ=UTC stat -f '%SB' -t "%Y-%m-%dT%H:%M:%SZ" ./path/to/file.txt # created
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment