fuser
Display process IDs currently using files. More information: https://keith.github.io/xcode-man-pages/fuser.1.html.
fuser {{path/to/file_or_directory}}
fuser -u {{path/to/file_or_directory}}