I am logging the output of:
top -b -n1 -c so I can keep track of which processes are using how much memory and CPU each minute. When top shows the full command line (
-c), the command line text gets truncated at the edge of the screen. This is perfect when running and displaying in a terminal. However, I am sending STDOUT to a file for parsing later and want the full command name logged. Is there a way I can tell top to use a specific screen width? (I know it maxes at 512, that would be fine)
Is there a better way to achieve a similar goal: get periodic stats about which processes are running and how many resources they are consuming?