When I run this command in Linux:
$ top -b -d 20 | grep "load average" -A 20 > top.log
top.log is always empty.
But when I run this command:
$ top -b -d 20 | grep "load average" -A 20 | tee top.log
then top.log has contents.
If I don't want to use
tee (because I don't want the output to be displayed onto the console), how do I correct the first command so that top.log is updated?
My machine uses CentOS Linux 7 (Core).