Capture running process or 2 hours with an interval of 10 sec

Hi,

Can any one help me on this.

How to capture the running process for two hours with an interval of 10 sec.

Thanks in andvance

Assuming you want the output on stdin (something similar to vmstat or iostat):

top -d 10 -n 720 -b

If you are interested in any particular process, use the -p option, for example to see the init process every 10 seconds for 1 hour:

top -d 10 -n 360 -b -p 1