Get Current Timestamp in Terminal

2021-05-28

A simple alias to return the current timestamp.

Yup, this time it is a really simple one. But since I keep adding it to my terminal configs I thought I share it with you.

To get the current timestamp you can run the following.

date +"%s"

As you can see it's only the date command with a format of %s.

Now if you find it useful - like me 😉 - then you can save it as an alias to your ~/.bashr or ~/.zshrc file.

alias timestamp='date +"%s"'

And that's it 😁