check if file is open with lsof

前端 未结 1 2045
旧巷少年郎
旧巷少年郎 2021-02-02 12:28

I\'m using linux mint 13 xfce and I have a file named wv.gold that I\'m trying to check in bash if it\'s open by any program (for instance, I opened it in sub

1条回答
  •  别跟我提以往
    2021-02-02 13:03

    The lines that appear in the output of lsof are open files. If your file is not there it means it is not open. Among the columns are PID (the process id of the program that has the file open) and the FD (the file descriptor associated with the open file). No particular value for these indicates open/closed. If it appears at all it means it's open.

    Check out http://linux.die.net/man/8/lsof and search for the text contains the first nine characters

    0 讨论(0)
提交回复
热议问题