How find out which process is using a file in Linux?

后端 未结 3 1881
生来不讨喜
生来不讨喜 2020-12-02 10:32

I tried to remove a file in Linux using rm -rf file_name, but got the error:

rm: file_name not removed.  Text file busy

How ca

3条回答
  •  -上瘾入骨i
    2020-12-02 10:40

    You can use the fuser command, like:

    fuser file_name
    

    You will receive a list of processes using the file.

    You can use different flags with it, in order to receive a more detailed output.

    You can find more info in the fuser's Wikipedia article, or in the man pages.

提交回复
热议问题