i got a data file which contains all the pid,ppid,user,command,pcpu,start_time,status. I wanted to display out the pcpu which is greater than 0.
i uses awk'{if($5 > 0){print}}' filename.txt but is printing out result which not i wanted. Is there any way which i can print out those pcpu which is greater than 0?
i have attached a sample of my data file. i would like to only display cpu which is above 0 from the data file. how can go with awk to make it display?
Some CMD column values contain spaces so for Awk (with default FS) %CPU is not always $5,
therefore as long as START and STAT values don't contain spaces $(NF-2)
(the number of fields of the crrent record - 2) will work