Might be idiotic, but I'm running a command that completes very fast, so I don't have enough time to lsof it from another window and see which files is it holding open. Is there some obvious way to run a command and immediately attach lsof to it? (and preferably to continue tracking which files is it opening until it completes)
edit - I can also be happy with attaching lsof to the process after it shuts down, I don't have to see the files it is opening in real time
lsof
doesn’t seem like the best solution for you... – Stephen Kitt Oct 08 '18 at 09:21