![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Algorithm In Pseudocode | delsega | UNIX for Advanced & Expert Users | 1 | 03-10-2008 11:10 AM |
| Help in Search Algorithm | bourne | SUN Solaris | 1 | 10-24-2005 02:33 PM |
| FTP's algorithm | toughguy2handle | High Level Programming | 1 | 09-23-2005 03:52 PM |
| Algorithm problem | williamf | High Level Programming | 1 | 07-26-2004 02:12 PM |
| Feedback algorithm | messier79 | High Level Programming | 0 | 03-17-2004 08:42 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
algorithm
Code:
PID USERNAME SIZE RSS STATE PRI NICE TIME CPU PROCESS/NLWP 21444 tomusr 213M 61M sleep 29 10 1:20:46 0.1% java/43 21249 root 93M 44M sleep 29 10 1:07:19 0.2% java/56 is there anyway i can use a command to get the total of the SIZE? 306M (Derive from 213M + 93M from SIZE) |
|
||||
|
I think awk (GNU) knows how to take care of that
Code:
# more file
PID USERNAME SIZE RSS STATE PRI NICE TIME CPU PROCESS/NLWP
21444 tomusr 213M 61M sleep 29 10 1:20:46 0.1% java/43
21249 root 93M 44M sleep 29 10 1:07:19 0.2% java/56
# awk '{s+=$3}END{print s}' file
306
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|