How to print prstat -Z output into a file

view full story

http://www.unix.com – Hi Expert, I want to print CPU and Memory utilization into a text file. I am using "prstat -Z" to see the output on screen. When I run below command Code: prstat -Z | grep httpd | awk '{print$3} '>> output.txt but it is not printing to file. Also I want to be below header on output Code: PID USERNAME  SIZE  RSS STATE  PRI NICE      TIME  CPU PROCESS/NLWP 6809 httpd 2229M  966M sleep  59    2  0:08:34 0.1% java/67 If anyone have solution for this, I will be appreciate Thanks in advance! Lalit (HowTos)