Wednesday, August 15, 2007

create screen timer from linux howto

Creating stopwatch or timer from your screen can be done so many ways. This can be applied when you need to track or watch the exact time duration for certain execution of a particular script commands or application.

How to create a timer using linux CLI commands?

Here are few ways to achieve the timer or stopwatch concept from command line terminal. As follow

1. This command shows real time values from your screen that is being updated every microsecond.

# watch -n 0 date

2. Issuing this command does not provide live screenview of current elapsed time or timer stats. Only then if you press Ctrl+C to stop the process, you'll get to see the elapsed time.

# time cat
# time tee

3. And the below approach makes use of available linux and bash commands like so

# while true; do clear; echo `date`; sleep 1s; done

It still works in Fedora!



Sign up for PayPal and start accepting credit card payments instantly.
ILoveTux - howtos and news | About | Contact | TOS | Policy