且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何找出哪个进程正在Linux中使用文件?

更新时间:2023-01-17 22:37:48

您可以使用fuser命令,例如:

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.

您可以在 fuser的Wikipedia文章man页.