![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| how to get persistant cpu utilization values per process per cpu in linux (! top,ps) | pankajd | UNIX for Dummies Questions & Answers | 3 | 10-09-2008 12:26 PM |
| Awk to print distinct col values | anduzzi | Shell Programming and Scripting | 22 | 08-18-2008 06:09 PM |
| Print column names along with values from SQL | thana | Shell Programming and Scripting | 5 | 07-24-2008 03:33 AM |
| Print Problem in UNIX. Need to know the option to specify the print paper size | ukarthik | HP-UX | 1 | 06-07-2007 10:35 AM |
| awk to print mon and max values of ranges | Mudshark | Shell Programming and Scripting | 3 | 02-02-2006 03:06 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
how to print the values of pcpu of any process in unix
hiiiiiiiiii
this is shyam.i have written a code that it will take the process id of any process and using it print the value of pcpu etc but the problem is it prints the same value every time it is in loop the code for this is given below. while true do y=`ps -p $pid -o pid,ppid,user,group,pcpu,pmem,rss,osz,vsz,comm` echo "$y" sleep 1s done i want to print all the frquently changing values . can anyone please help me |
|
||||
|
Quote:
13 1 root root 0.8 0 05:51:11 0.0 0 0 0 [kjournald] 13 1 root root 0.8 0 05:51:11 0.0 0 0 0 [kjournald] 13 1 root root 0.8 0 05:51:11 0.0 0 0 0 [kjournald] 13 1 root root 0.8 0 05:51:11 0.0 0 0 0 [kjournald] 13 1 root root 0.8 0 05:51:11 0.0 0 0 0 [kjournald] 13 1 root root 0.8 0 05:51:11 0.0 0 0 0 [kjournald] 13 1 root root 0.8 0 05:51:11 0.0 0 0 0 [kjournald] 13 1 root root 0.8 0 05:51:11 0.0 0 0 0 [kjournald] 13 1 root root 0.8 0 05:51:11 0.0 0 0 0 [kjournald] this is the output where 0.8 is pcpu but everytime it is 0.8 but originally it is varying and i want pcpu to be varying everytime |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|