How to get the epoch timestamp in Bash?

In Bash, how to get the epoch timestamp, the number of seconds passed since the epoch?

asked May 23, 2017 by dtivl (2,500 points)

1 Answer

In Bash, you can call the date command with format option "+%s":

date +%s

Here, "%s" means:

%s

seconds since 1970-01-01 00:00:00 UTC
answered May 27, 2017 by dtivl (2,500 points)

Please log in or register to answer this question.

Copyright © SysTutorials. User contributions licensed under cc-wiki with attribution required.
Hosted on Dreamhost

...