LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 07-10-2012, 05:19 AM   #1
henrysimon
LQ Newbie
 
Registered: Jun 2012
Posts: 7

Rep: Reputation: Disabled
Solaris to Linux porting (prstat -Z -n 1 1 1 ----command help)


Hi,

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/){
$proc_usage=$16;

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.

Thanks,
Henry
 
Old 07-11-2012, 03:27 PM   #2
kbscores
Member
 
Registered: Oct 2011
Location: USA
Distribution: Red Hat
Posts: 259
Blog Entries: 9

Rep: Reputation: 32
The command you'd want is top.

Code:
top
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
What is the Linux equivalant commands of Solaris' prstat & ptree? parunachalam Linux - Newbie 2 12-08-2011 06:25 PM
solaris to linux porting vinod_indus Linux - General 3 09-12-2005 10:51 AM
Porting from Solaris to Linux gan_04 Linux - General 2 07-15-2005 08:37 AM
Porting from Solaris to Linux raees Linux - General 3 11-10-2003 09:26 AM
Porting from Solaris 2.6 to Linux rajneesh_134 Solaris / OpenSolaris 1 10-22-2003 09:20 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 10:13 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration