Find files opened by a program? - Slackware

This is a discussion on Find files opened by a program? - Slackware ; Chaps, looking for the wisdom of the newsgroup. If I want to find the files opened by a program is there a command that lets me do so? At the moment googling and making best guesses is not quite getting ...

+ Reply to Thread
Results 1 to 4 of 4

Thread: Find files opened by a program?

  1. Find files opened by a program?

    Chaps,

    looking for the wisdom of the newsgroup. If I want to find the files opened
    by a program is there a command that lets me do so? At the moment googling
    and making best guesses is not quite getting me there.

    Pete
    --
    http://www.petezilla.co.uk

  2. Re: Find files opened by a program?

    On Mon, 13 Oct 2008 21:02:32 +0100, Peter Chant wrote:

    > If I want to find the files opened by a program is
    > there a command that lets me do so?


    man lsof

  3. Re: Find files opened by a program?

    Peter Chant wrote:
    > looking for the wisdom of the newsgroup. If I want to find the files opened
    > by a program is there a command that lets me do so? At the moment googling
    > and making best guesses is not quite getting me there.


    To see all the files a program currently has open, try
    # lsof -c progname
    or
    # lsof -p pid


    To see all the files (including linked libraries) a program tries
    opening, run the program using strace
    # strace -f -ff -o log -e trace=open progname [args]

    Or attach to a running process via
    # strace -f -ff -o log -e trace=open -p pid

    - Daniel

  4. Re: Find files opened by a program?

    D Herring wrote:

    > To see all the files (including linked libraries) a program tries
    > opening, run the program using strace
    > # strace -f -ff -o log -e trace=open progname [args]
    >


    Thanks, exactly what I want. Trying to build a slax module with selected
    bits of my kde configuration in it and guesswork is not getting me there.
    Looking at the amount of logs produced by kontact it looks like I've got a
    reasonable amount of work to do.

    Pete


    --
    http://www.petezilla.co.uk

+ Reply to Thread