0
I am trying to gather information for CPU use for all the processors in a text file.
mpstat -P ALL -u 1 | awk '{print $4}' > cpu.txt
&&
mptat -P ALL -u 1 | awk '{print $4}' | tee cpu.txt
Neither of them seems to work when piped.
Any suggestions to get this working.
Much appreciated.
Any way I can execute this command in Python?
say e.g
subprocess.call('mpstat -P ALL | awk '{print $4}' >>cpu.txt', shell=True)
– Quick Silver – 2013-05-22T04:17:33.5831Well, you probably need to escape the quotes in the string. – Scott – 2013-05-22T21:18:44.130