Determine how long a file has been open

0

0

Is it possible in linux to determine how long a file has been open for? I have a process I suspect is performing long running operations on some files, but I'm unsure how to check.

Ceilingfish

Posted 2018-05-04T10:14:40.020

Reputation: 191

Answers

0

Perhaps not the answer you are looking for, but ps has lstart as a standard format specifier.

lstart STARTED time the command started. See also bsdstart, start, start_time, and stime.

So in your case ps -eo pid,lstart,cmd could indicate how long a specific command is running.

-e            Select all processes.
-o format     User-defined format.

rowan

Posted 2018-05-04T10:14:40.020

Reputation: 21