Unix/Linux Go Back    


Linux RedHat, Ubuntu, SUSE, Fedora, Debian, Mandriva, Slackware, Gentoo linux, PCLinuxOS. All Linux questions here!

Ps command on cpu usage and time

Linux


Reply    
 
Thread Tools Search this Thread Display Modes
    #1  
Old Unix and Linux 1 Week Ago
venky456 venky456 is offline
Registered User
 
Join Date: Oct 2017
Last Activity: 16 October 2017, 8:48 AM EDT
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Ps command on cpu usage and time

Hi All,

Am very new to Linux and unix ...need below help .
need to list of process consuming more than 40% cpu and which are older than 10 days of a particular user ....



Thanks
V
Sponsored Links
    #2  
Old Unix and Linux 1 Week Ago
Scott's Unix or Linux Image
Scott Scott is offline Forum Staff  
Administrator
 
Join Date: Jun 2009
Last Activity: 20 October 2017, 3:07 PM EDT
Location: Zürich
Posts: 8,750
Thanks: 356
Thanked 1,161 Times in 995 Posts
Quote:
Originally Posted by venky456 View Post
Hi All,

Am very new to Linux and unix ...need below help .
need to list of process consuming more than 40% cpu and which are older than 10 days of a particular user ....



Thanks
V
If you have a process using 40% CPU and (keyword AND) older than 10 days, you need to kill it, or fix it Linux

Auditing. Do you have any auditing running? The question's vague, but this isn't the kind of thing you can just 'pluck' out of the air.
Sponsored Links
    #3  
Old Unix and Linux 1 Week Ago
venky456 venky456 is offline
Registered User
 
Join Date: Oct 2017
Last Activity: 16 October 2017, 8:48 AM EDT
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
first i need check which process are those consuming more than 40% cpu AND 10 days older and then need to fix them

---------- Post updated at 01:29 AM ---------- Previous update was at 01:11 AM ----------

can someone help me with the command
    #4  
Old Unix and Linux 1 Week Ago
RavinderSingh13 RavinderSingh13 is online now Forum Advisor  
Registered User
 
Join Date: May 2013
Last Activity: 20 October 2017, 5:34 PM EDT
Location: Chennai
Posts: 2,634
Thanks: 582
Thanked 1,253 Times in 1,128 Posts
Quote:
Originally Posted by venky456 View Post
first i need check which process are those consuming more than 40% cpu AND 10 days older and then need to fix them
---------- Post updated at 01:29 AM ---------- Previous update was at 01:11 AM ----------
can someone help me with the command
Hello venky456,

So this is how I would deal with this kind of situation during the period of issue.
Check the server's memory and cpu first with commands as follows.
To get memory details:

Code:
free -g

To get CPU details: This will run 20 times in difference of 1 second or so, you could increase the values as per your convenience.
Solution 1st:

Code:
vmstat 1 20

Solution 2nd: This will provide you all processes and you could sort it as per your need for CPU, memory etc and could find out the culprits.

Code:
top
OR
htop

There are other ways too, but you could take it as a starting point. Let me know in case of any queries.

Thanks,
R. Singh
Sponsored Links
    #5  
Old Unix and Linux 1 Week Ago
RudiC RudiC is offline Forum Staff  
Moderator
 
Join Date: Jul 2012
Last Activity: 20 October 2017, 2:22 PM EDT
Location: Aachen, Germany
Posts: 11,479
Thanks: 310
Thanked 3,561 Times in 3,276 Posts
Now, your question is quite vague. What is your ultimate goal? For finding the process(es), you already named the ps command - does it do what you want or are you stuck somewhere?

If you want to go further, analyze and correct the program / application - which is the way to go - there's more than one command necessary. You need to dig deep into the run time environment, the input data and channels, and eventually read and understand the program's source code. Be prepared for a lengthy process for "fixing" the culprit.
Sponsored Links
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Linux More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Storage usage over time venus699 Shell Programming and Scripting 4 4 Weeks Ago 05:48 AM
Memory usage per user,percent usage,sytem time in ksh roy1912 UNIX for Dummies Questions & Answers 2 03-24-2014 06:21 AM
Command to display the space usage (memory usage) of a specific directory. abhisheksunkari UNIX for Dummies Questions & Answers 2 11-12-2010 03:26 AM
how can I find cpu usage memory usage swap usage and logical volume usage alert0919 HP-UX 3 12-02-2008 01:38 PM
time command usage in sh script kris_search Shell Programming and Scripting 7 03-09-2007 01:40 PM



All times are GMT -4. The time now is 05:35 PM.