Find the answer to your Linux question:
Results 1 to 4 of 4
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1

    Solaris to Linux porting (prstat -Z -n 1 1 1 ----command help)


    I need the equivalent of `prstat -Z -n 1 1 1` command in Linux.

    My script is something like this:

    $prstat_out=`prstat -Z -n 1 1 1`;
    lines = split (/\n/, $prstat_out);
    foreach $line (lines){
    if ($line =~ /(\s+)(\d+)(\s+)(\d+)(\s+)(\d+.*)(\s+)(\d+.*)(\s+)( \d+)%(\s+)(.*).*).*)(\s+)(.*)% global/){

    print "The CPU usage is $proc_usage ";

    This will print the CPU usage in percentage in Solaris.

    Can anybody help me in knowing the equivalent in Linux.


  2. #2

    Solaris to Linux porting (prstat -Z -n 1 1 1 ----command help)

    Try 'top -n 1' - and rearrange your parsing logic...

  3. #3

    The issue is solved...

  4. $spacer_open
  5. #4
    Although the topic is solved, this might add some info for others that are looking for something similar:
    DTrace Troubleshooting

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts