Top Batch Mode
Had a question guys. Was playing around with Top command and wanted to see if there is a way to log only the top 15 process. When logging in batch mode.... The output is very long, I just want the first 22 lines to be logged.
Will log the top output every minute... but will log everything.
top -b -d 60 >topLog.txt
I tried different combinations with head command...
top -b -d 60 | head -22 >topLog.txt
The first command gave me the output I was looking for... but did not repeat every minute as I was hoping.
top -d 60 | head -22 >topLog.txt
The second command didn't work at all.. as the output was messed up.
I am still relatively new to using CLI commands and may be combining them wrong, If anyone has any tips on how to get what I'm Looking for, please let me know. Thanks Ahead.
"That which we persist in doing becomes easier, not that the task itself has become easier, but that our ability to perform it has improved."
--Ralph Waldo Emerson