I have a script that collects the size of a file that is being constantly fed. I'm echoing its size to a log file (echo 'filesize is $size' > log.txt) so I only have the last size information. So, only one line.
Now, in another terminal, I wanted to tail that log file to see its size increasing in real time. It turns out, tail -f path/to/file gives me the output I want but it keeps jumping to the next line (as expected, I guess).
So, the output is something like:
$ tail -F log.txt 2>/dev/null
filesize is 1.658 GB
filesize is 1.659 GB
filesize is 1.659 GB
filesize is 1.660 GB
I wanted something more like the command "less" in which you don't have the cursor back. Maybe a better example would be "mtr", that keeps updating the information on the screen without going to next line (as opposed to traceroute).
Thank you,
watch du -skh filename
.StackOverflow
community is solving problems programmatically and request for general software utilities tools are more relevant at superuser.com