Operating System - Linux
1829662 Members
10074 Online
109992 Solutions
New Discussion

Re: find the uptime of a process

 
SOLVED
Go to solution
labadie_1
Honored Contributor

find the uptime of a process

I know that in /proc/pid/fd I find the files opened by a process.

I would like to know when a process has been created, or the uptime of the process.

Is this info available somewhere ?

Thanks for any hint
5 REPLIES 5
Steven E. Protter
Exalted Contributor
Solution

Re: find the uptime of a process

Shalom,

ps -ef | grep process_name

UNIX95=1
ps -C

there are a while array of ps commands to tell you process details.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
labadie_1
Honored Contributor

Re: find the uptime of a process

Hello

The basic ps -ef seems to show the day, not the exact date, but it should be close enough :-)

I have a prehistorical Red Hat Entreprise 7.3 and ps -C is not available.

What do you mean with Unix95=1 ?
labadie_1
Honored Contributor

Re: find the uptime of a process

ps -o "%t" 28730

gives exactly what I want for the process 28730

thanks.
Victor Semaska_3
Esteemed Contributor

Re: find the uptime of a process

labadie,

There's also this command to see the creation date/time of processes:

# ps -eo user,pid,lstart,cmd

Vic
There are 10 kinds of people, one that understands binary and one that doesn't.
labadie_1
Honored Contributor

Re: find the uptime of a process

It doesn't work with Red Hat 7.3

ps: error: Unknown user-defined format specifier.
usage: ps -[Unix98 options]
ps [BSD-style options]
ps --[GNU-style long options]
ps --help for a command summary

:-(