I want to insert vmstat output to a file in every 10 seconds. I use the following command to do it.
vmstat 10 > vmstatfile.txt
This will create a file named vmstatfile.txt and appends to it, on every 10 seconds. What I want is, my file should always contain a single vmstat entry, the latest one, so that the file will not grow. Is this possible? Then how can I do this?