2

I want to find the time after 10 minutes using date command in shell.

3
  • 4
    sleep 600 ; date? You can edit your post with more specifics of what you're trying to do. Commented Nov 25, 2015 at 7:00
  • 1
    Is this homework?
    – cutrightjm
    Commented Nov 25, 2015 at 7:25
  • 1
    @ekaj of course not, it's a hot network question! Commented Nov 25, 2015 at 10:34

1 Answer 1

15

try:

date -d "+ 10 minutes"

The date command is quite flexible about the text that you can use. For instance:

date -d "next Tuesday"

And you can choose the output format as well, for instance if you want as seconds since epoch:

date -d "3 weeks" +%s 
2
  • 3
    For those of us who like to spell things out, "now + 10 minutes" or "now + 3 weeks" also works. Commented Nov 25, 2015 at 7:44
  • Can also use 10min.
    – 123
    Commented Nov 25, 2015 at 10:01

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .