shell

Show version

$ ${SHELL} --version
zsh 5.8.1 (x86_64-apple-darwin21.0)

Date

Translate from unix timestamp to ymdhms:

$ date -j -f "%s" "+%Y-%m-%d %H:%M:%S" 1737000000
2025-01-16 12:00:00

Translate from ymdhms to unix timestamp:

$ date -j -f "%Y-%m-%d %H:%M:%S" "+%s" "2025-01-16 12:00:00"
1737000000

Remove executable flags recursively

$ sudo chmod -R -x photo
$ chmod -R +X photo

Find empty directories

Find empty directories:

$ find . -type d -empty

Also delete them:

$ find . -type d -empty -delete