0

How can I know if the version of a program which is currently running is the one residing on disk, or if it is an older version (that may have been replaced, e.g., by an upgrade?)

0

1 Answer 1

0

Use lsof -p PID and check for the "txt" field (4th column) if there is a (deleted) next to the file name in the last field.

On Debian, you can also use the checkrestart utility (but it may not catch all cases).

3
  • 1
    Note that lsof just does the equivalent of readlink /proc/PID/exe, it's a bit of a heavyweight tool for reading that information. Commented Apr 15, 2021 at 12:58
  • So is it just "an exexutable with the same name/path still exists"?
    – Tom Yan
    Commented Apr 15, 2021 at 13:23
  • No, the important case is to distinguish the case where there is an executable with the same name/path but it is not the version of the program which is currently running.
    – a3nm
    Commented Apr 15, 2021 at 14:15

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .