Files and folders

Find which program is using a file

When a file or folder won't delete because it's in use, find what's holding it.

Fill these in once
  1. Find what has the file open
    Terminal
    lsof report.xlsx
  2. Or everything open inside a folder
    Terminal
    lsof +D my-folder
  1. Find what has the file open
    Terminal · Ubuntu / Debian
    lsof report.xlsx
  2. Or everything open inside a folder
    Terminal · Ubuntu / Debian
    lsof +D my-folder
  1. Install Microsoft's Handle tool
    PowerShell
    winget install Microsoft.Sysinternals.Handle
  2. Find what has the file openRun as administrator
    PowerShell
    handle report.xlsx

    Or open Resource Monitor (resmon), go to CPU, and search Associated Handles.