How Do You Check Which Process Is Writing to a File in Linux?
Contents

How can I tell what process created a file?

Detecting which process is creating a file using LD_PRELOAD trick

  1. Using auditd. auditd is a subsystem for monitoring and accounting for Linux. …
  2. Using strace, dtrace or a similar tool for tracking syscalls. Another approach is using a tool like strace or dtrace which allows you to monitor all the system calls used by a running process. …
  3. Using inotify. …
  4. Using fuser.

8 янв. 2014 г.

How do you find which process is creating a file in Unix?

5 Answers. The lsof command (already mentioned in several answers) will tell you what process has a file open at the time you run it. lsof is available for just about every unix variant.

Sophia Al-Mansoor

Sophia Al-Mansoor

Global Business & E-Commerce Reporter

Sophia analyzes international trade, startup ecosystems, retail transformation, and supply chain logistics for modern digital publications.

Share this article
Twitter Facebook Pinterest