Search for processes which are CPU consumming
Clash Royale CLAN TAG#URR8PPP
up vote
1
down vote
favorite
I can track the process launched by the user4
with awk
:
ps aux | awk '$1~/user4/'
And also to track what process consume more than 10% CPU
:
ps aux | awk '$3> 10'
How can I combine both with awk
, aka search for process launched by user4
which are consumming more than 10% CPU
?
command-line awk ps
add a comment |Â
up vote
1
down vote
favorite
I can track the process launched by the user4
with awk
:
ps aux | awk '$1~/user4/'
And also to track what process consume more than 10% CPU
:
ps aux | awk '$3> 10'
How can I combine both with awk
, aka search for process launched by user4
which are consumming more than 10% CPU
?
command-line awk ps
add a comment |Â
up vote
1
down vote
favorite
up vote
1
down vote
favorite
I can track the process launched by the user4
with awk
:
ps aux | awk '$1~/user4/'
And also to track what process consume more than 10% CPU
:
ps aux | awk '$3> 10'
How can I combine both with awk
, aka search for process launched by user4
which are consumming more than 10% CPU
?
command-line awk ps
I can track the process launched by the user4
with awk
:
ps aux | awk '$1~/user4/'
And also to track what process consume more than 10% CPU
:
ps aux | awk '$3> 10'
How can I combine both with awk
, aka search for process launched by user4
which are consumming more than 10% CPU
?
command-line awk ps
command-line awk ps
edited Aug 21 at 8:17
Rui F Ribeiro
36.7k1271116
36.7k1271116
asked Mar 22 '16 at 9:08
Colonel Beauvel
1163
1163
add a comment |Â
add a comment |Â
2 Answers
2
active
oldest
votes
up vote
1
down vote
Ok ... I found it reading more awk
documentation, sorry for disturbing:
ps aux | awk '$1~/user4/ && $3> 0'
1
since ~ is pattern-matching, be careful if you ever end up with a "user44" or "ruser4"
â Jeff Schaller
Mar 22 '16 at 11:01
this is completely true! I went for '$1~/user4$/ && $3> 0' to avoid this
â Colonel Beauvel
Mar 22 '16 at 11:22
1
Consider == as well
â Jeff Schaller
Mar 22 '16 at 11:31
add a comment |Â
up vote
1
down vote
or as an alternative
ps -u user4 -o pcpu,args | awk '$1>0'
see man ps
for arguement of -o
, some argument might be cputime,etime,args,comm,tty
hum despite I like the idea, the totla command returns nothing on my side, but when I only dops -u user4
I have the PID, TTY, TIME and CMD.
â Colonel Beauvel
Mar 22 '16 at 11:25
try adding XPG4= or UNIX95= before ps
â Archemar
Mar 22 '16 at 11:53
add a comment |Â
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
1
down vote
Ok ... I found it reading more awk
documentation, sorry for disturbing:
ps aux | awk '$1~/user4/ && $3> 0'
1
since ~ is pattern-matching, be careful if you ever end up with a "user44" or "ruser4"
â Jeff Schaller
Mar 22 '16 at 11:01
this is completely true! I went for '$1~/user4$/ && $3> 0' to avoid this
â Colonel Beauvel
Mar 22 '16 at 11:22
1
Consider == as well
â Jeff Schaller
Mar 22 '16 at 11:31
add a comment |Â
up vote
1
down vote
Ok ... I found it reading more awk
documentation, sorry for disturbing:
ps aux | awk '$1~/user4/ && $3> 0'
1
since ~ is pattern-matching, be careful if you ever end up with a "user44" or "ruser4"
â Jeff Schaller
Mar 22 '16 at 11:01
this is completely true! I went for '$1~/user4$/ && $3> 0' to avoid this
â Colonel Beauvel
Mar 22 '16 at 11:22
1
Consider == as well
â Jeff Schaller
Mar 22 '16 at 11:31
add a comment |Â
up vote
1
down vote
up vote
1
down vote
Ok ... I found it reading more awk
documentation, sorry for disturbing:
ps aux | awk '$1~/user4/ && $3> 0'
Ok ... I found it reading more awk
documentation, sorry for disturbing:
ps aux | awk '$1~/user4/ && $3> 0'
answered Mar 22 '16 at 9:16
Colonel Beauvel
1163
1163
1
since ~ is pattern-matching, be careful if you ever end up with a "user44" or "ruser4"
â Jeff Schaller
Mar 22 '16 at 11:01
this is completely true! I went for '$1~/user4$/ && $3> 0' to avoid this
â Colonel Beauvel
Mar 22 '16 at 11:22
1
Consider == as well
â Jeff Schaller
Mar 22 '16 at 11:31
add a comment |Â
1
since ~ is pattern-matching, be careful if you ever end up with a "user44" or "ruser4"
â Jeff Schaller
Mar 22 '16 at 11:01
this is completely true! I went for '$1~/user4$/ && $3> 0' to avoid this
â Colonel Beauvel
Mar 22 '16 at 11:22
1
Consider == as well
â Jeff Schaller
Mar 22 '16 at 11:31
1
1
since ~ is pattern-matching, be careful if you ever end up with a "user44" or "ruser4"
â Jeff Schaller
Mar 22 '16 at 11:01
since ~ is pattern-matching, be careful if you ever end up with a "user44" or "ruser4"
â Jeff Schaller
Mar 22 '16 at 11:01
this is completely true! I went for '$1~/user4$/ && $3> 0' to avoid this
â Colonel Beauvel
Mar 22 '16 at 11:22
this is completely true! I went for '$1~/user4$/ && $3> 0' to avoid this
â Colonel Beauvel
Mar 22 '16 at 11:22
1
1
Consider == as well
â Jeff Schaller
Mar 22 '16 at 11:31
Consider == as well
â Jeff Schaller
Mar 22 '16 at 11:31
add a comment |Â
up vote
1
down vote
or as an alternative
ps -u user4 -o pcpu,args | awk '$1>0'
see man ps
for arguement of -o
, some argument might be cputime,etime,args,comm,tty
hum despite I like the idea, the totla command returns nothing on my side, but when I only dops -u user4
I have the PID, TTY, TIME and CMD.
â Colonel Beauvel
Mar 22 '16 at 11:25
try adding XPG4= or UNIX95= before ps
â Archemar
Mar 22 '16 at 11:53
add a comment |Â
up vote
1
down vote
or as an alternative
ps -u user4 -o pcpu,args | awk '$1>0'
see man ps
for arguement of -o
, some argument might be cputime,etime,args,comm,tty
hum despite I like the idea, the totla command returns nothing on my side, but when I only dops -u user4
I have the PID, TTY, TIME and CMD.
â Colonel Beauvel
Mar 22 '16 at 11:25
try adding XPG4= or UNIX95= before ps
â Archemar
Mar 22 '16 at 11:53
add a comment |Â
up vote
1
down vote
up vote
1
down vote
or as an alternative
ps -u user4 -o pcpu,args | awk '$1>0'
see man ps
for arguement of -o
, some argument might be cputime,etime,args,comm,tty
or as an alternative
ps -u user4 -o pcpu,args | awk '$1>0'
see man ps
for arguement of -o
, some argument might be cputime,etime,args,comm,tty
answered Mar 22 '16 at 10:42
Archemar
19.1k93467
19.1k93467
hum despite I like the idea, the totla command returns nothing on my side, but when I only dops -u user4
I have the PID, TTY, TIME and CMD.
â Colonel Beauvel
Mar 22 '16 at 11:25
try adding XPG4= or UNIX95= before ps
â Archemar
Mar 22 '16 at 11:53
add a comment |Â
hum despite I like the idea, the totla command returns nothing on my side, but when I only dops -u user4
I have the PID, TTY, TIME and CMD.
â Colonel Beauvel
Mar 22 '16 at 11:25
try adding XPG4= or UNIX95= before ps
â Archemar
Mar 22 '16 at 11:53
hum despite I like the idea, the totla command returns nothing on my side, but when I only do
ps -u user4
I have the PID, TTY, TIME and CMD.â Colonel Beauvel
Mar 22 '16 at 11:25
hum despite I like the idea, the totla command returns nothing on my side, but when I only do
ps -u user4
I have the PID, TTY, TIME and CMD.â Colonel Beauvel
Mar 22 '16 at 11:25
try adding XPG4= or UNIX95= before ps
â Archemar
Mar 22 '16 at 11:53
try adding XPG4= or UNIX95= before ps
â Archemar
Mar 22 '16 at 11:53
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f271419%2fsearch-for-processes-which-are-cpu-consumming%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password