03-23-2007
Top command
Hey,
Using one single line of command i am trying to show the CPU usage for 4 processors and then filter it out and write it to a text file. Everything seams ok except that i am not able to switch from having the top command show me all CPU processes seperate opposed to showing me the average of all 4.
I know once i go into top, i can toggle that option by hitting the '1' key. However, i would like to have one command that does this.
I've looked into different configurations files as well but no luck. Any ideas or help would be appreciated. Thanck You
Georges A A
EX:
top -n 1 | cat | head -6 | tail -3 | tr -cs 'a-z',.,'0-9' '\n' | sed '1,8d' | sed '2,8d' | sed '3,9d'> /output.txt
This commmand will get and filter the CPU process and write it to a text file. However, this is only displaying the average of all 4.
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
I understand the numbers displayed in variable "load average". My question: what are the correct/ideal numbers?
Sometimes, I got less than 1. Others, above 6.
Also, what HW/SW should I tune in order to have the ideal numbers?
Thank you ... (1 Reply)
Discussion started by: dgromerog
1 Replies
2. UNIX for Dummies Questions & Answers
hi guys,
i am having a dual cpu xeon machine.
i came to know that i can view the performance by giving top command.
but top command shows only the usage of one cpu in percentage
while the process are using more than 100% usage in the list .
can i know separately the usage of cpus.
can you... (5 Replies)
Discussion started by: bijuhpd
5 Replies
3. SCO
Is there a command in SCO Unix that does the same as the top command in HPUX. The command displays the jobs using the most system resources.
Thanks You (0 Replies)
Discussion started by: joestrosser
0 Replies
4. UNIX for Dummies Questions & Answers
Hey,
Using one single line of command i am trying to show the CPU usage for 4 processors and then filter it out and write it to a text file. Everything seams ok except that i am not able to switch from having the top command show me all CPU processes seperate opposed to showing me the average of... (0 Replies)
Discussion started by: Georgesaa
0 Replies
5. Solaris
Hi,
How to install software package top in solaris, (4 Replies)
Discussion started by: manoj.solaris
4 Replies
6. Shell Programming and Scripting
Hi ,
can some one please assist me in using top command
im facing following after using top:
# top -hv
UX:sh (top): ERROR: top: syntax error at line 1: `(' unexpected
# top -p
UX:sh (top): ERROR: top: syntax error at line 1: `(' unexpected
thanks in advance (3 Replies)
Discussion started by: NIMISH AGARWAL
3 Replies
7. AIX
Is there a 'top' command equivalent in AIX 4.2 ?
I already checked and I do not see the following ones anywhere:
top
nmon
topas (1 Reply)
Discussion started by: Browser_ice
1 Replies
8. Shell Programming and Scripting
Hi all,
I found like top command could be used to find the Memory and CPU utilization. But i want to know how to find the Memory and CPU utilization for a particular user using top command.
Thanks in advance.
Thanks,
Ananthi.U (2 Replies)
Discussion started by: ananthi_ku
2 Replies
9. Shell Programming and Scripting
Currently when i run top command i get the following columns .
CPU TTY PID USERNAME PRI NI SIZE RES STATE TIME %WCPU %CPU COMMAND
In this how to remove '%WCPU' column ?
Thanks very much in advance . (6 Replies)
Discussion started by: kpravinraj
6 Replies
10. Shell Programming and Scripting
Hi All,
i am using the below command and once get the output and i need to keep the
first batch only.in this case how to do this one. please help me on thistop -b -n 5 >top.txt
Thanks, (3 Replies)
Discussion started by: bmk
3 Replies
LEARN ABOUT PHP
datefmt_is_lenient
DATEFMT_IS_LENIENT(3) 1 DATEFMT_IS_LENIENT(3)
IntlDateFormatter::isLenient - Get the lenient used for the IntlDateFormatter
Object oriented style
SYNOPSIS
public bool IntlDateFormatter::isLenient (void )
DESCRIPTION
Procedural style
bool datefmt_is_lenient (IntlDateFormatter $fmt)
Check if the parser is strict or lenient in interpreting inputs that do not match the pattern exactly.
PARAMETERS
o $fmt
- The formatter resource.
RETURN VALUES
TRUE if parser is lenient, FALSE if parser is strict. By default the parser is lenient.
EXAMPLES
Example #1
datefmt_is_lenient(3) example
<?php
$fmt = datefmt_create(
'en_US',
IntlDateFormatter::FULL,
IntlDateFormatter::FULL,
'America/Los_Angeles',
IntlDateFormatter::GREGORIAN,
'dd/mm/yyyy'
);
echo 'lenient of the formatter is : ';
if ($fmt->isLenient()) {
echo 'TRUE';
} else {
echo 'FALSE';
}
datefmt_parse($fmt, '35/13/1971');
echo "
Trying to do parse('35/13/1971').
Result is : " . datefmt_parse($fmt, '35/13/1971');
if (intl_get_error_code() != 0) {
echo "
Error_msg is : " . intl_get_error_message();
echo "
Error_code is : " . intl_get_error_code();
}
datefmt_set_lenient($fmt,false);
echo 'Now lenient of the formatter is : ';
if ($fmt->isLenient()) {
echo 'TRUE';
} else {
echo 'FALSE';
}
datefmt_parse($fmt, '35/13/1971');
echo "
Trying to do parse('35/13/1971').Result is : " . datefmt_parse($fmt, '35/13/1971');
if (intl_get_error_code() != 0) {
echo "
Error_msg is : " . intl_get_error_message();
echo "
Error_code is : " . intl_get_error_code();
}
?>
Example #2
OO example
<?php
$fmt = new IntlDateFormatter(
'en_US',
IntlDateFormatter::FULL,
IntlDateFormatter::FULL,
'America/Los_Angeles',
IntlDateFormatter::GREGORIAN,
"dd/mm/yyyy"
);
echo "lenient of the formatter is : ";
if ($fmt->isLenient()) {
echo 'TRUE';
} else {
echo 'FALSE';
}
$fmt->parse('35/13/1971');
echo "
Trying to do parse('35/13/1971').
Result is : " . $fmt->parse('35/13/1971');
if (intl_get_error_code() != 0){
echo "
Error_msg is : " . intl_get_error_message();
echo "
Error_code is : " . intl_get_error_code();
}
$fmt->setLenient(FALSE);
echo 'Now lenient of the formatter is : ';
if ($fmt->isLenient()) {
echo 'TRUE';
} else {
echo 'FALSE';
}
$fmt->parse('35/13/1971');
echo "
Trying to do parse('35/13/1971').
Result is : " . $fmt->parse('35/13/1971');
if (intl_get_error_code() != 0) {
echo "
Error_msg is : " . intl_get_error_message();
echo "
Error_code is : " . intl_get_error_code();
}
?>
The above example will output:
lenient of the formatter is : TRUE
Trying to do parse('35/13/1971').
Result is : -2147483
Now lenient of the formatter is : FALSE
Trying to do parse('35/13/1971').
Result is :
Error_msg is : Date parsing failed: U_PARSE_ERROR
Error_code is : 9
SEE ALSO
datefmt_set_lenient(3), datefmt_create(3).
PHP Documentation Group DATEFMT_IS_LENIENT(3)