Thursday, September 1, 2022

[SOLVED] Getting process from yesterday

Issue

I want to obtain all the process that are running in the system, but only from yesterday.

I am using this, ps -eo etime,pid

but i need only list the process from yesterday, any idea?

INFO: active from yesterday, process actually running from yesterday

Thanks in advance


Solution

If you want all the pids that have been running for more than 1 day but less than 2:

ps -e -o pid= -o etime= | sed 's/^ *//' | awk -F '[ -]+' 'NF>2 && $2==1 {print $1}'

if you want just more than 1 day, change it to $2>=1



Answered By - Diego Torres Milano
Answer Checked By - Mildred Charles (WPSolving Admin)