fuser

list the process ids of things using a file

It’s unclear what exactly fuser can do, But the relevant bit that has been useful to me is fuser -cfu path/to/file which will tell you what processes have a lock on a file.

For example: SQLite might be complaining that a database is locked when you try and access it. fuser will tell you which processes are accessing it.

Usage

fuser: [-cfu] file ...
    -c  file is treated as mount point
    -f  the report is only for the named files
    -u  print username of pid in parenthesis

Metadata:

  • Language: c

Tags:

  • filesystem
  • processes