There are two excellent answers already but I'd like to expand a bit. Copy and paste command below into your terminal:
$ sleep 3d 5h 7m 30.05s &
[1] 7321
This will start a second process that will sleep for 3 days, 5 hours, 7 minutes and 30.05 seconds. The process ID (PID) is 7321 in my case.
To confirm the PID use
$ ps aux | grep sleep
rick 7321 0.0 0.0 14356 660 pts/2 S 22:40 0:00 sleep 3d 5h 7m 30.05s
root 12415 0.0 0.0 14356 700 ? S 22:41 0:00 sleep 60
rick 12500 0.0 0.0 21292 968 pts/2 R+ 22:41 0:00 grep --color=auto sleep
The first entry is the one we are interested in. The second entry is for a permanent program I have running in startup. The third entry is for the grep command itself.
From the manpage:
So:
Another way to do this is:
There are two excellent answers already but I'd like to expand a bit. Copy and paste command below into your terminal:
This will start a second process that will sleep for 3 days, 5 hours, 7 minutes and 30.05 seconds. The process ID (PID) is
7321
in my case.To confirm the PID use
The first entry is the one we are interested in. The second entry is for a permanent program I have running in startup. The third entry is for the grep command itself.
Now to see how much time is remaining (in seconds) for the
sleep
command generated by PID7321
we can use this: How to determine the amount of time left in a “sleep”? command:The code for the command you can include in your
~/.bashrc
file:Command sleep is always counting in seconds. You could use ((7x60)+30) seconds and then type simply: