4

I know lsof, which shows me the files opened by a running process, but if I launch a command, like calendar, that terminates immediately.

How can I see what config files are read?

0

2 Answers 2

2

I would use strace -efile calendar for this. The resulting output is a little hard to read, but it shows every file-related action, including failed attempts at opening files and uses of 'stat' to see if a file exists.

0

I use find -mmin -2 or find -amin -2 to see which files were concerned by a command.

2
  • 1
    This only works if the atime is recorded, which is often not the case. Also, how exactly would you see which command opened a file returned by find?
    – slhck
    Dec 13, 2012 at 9:24
  • It's a raw technique but I launch find etc before and after the command so I can see what change. I agree it's not precise but it often help.
    – breard
    Dec 13, 2012 at 12:54

You must log in to answer this question.

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