Find open files that were deleted
Build a paste-ready command, then review its compatibility and effects before running it.
read-onlyno known side effects Compatibility
LinuxVerified for Linux using posix, bash, zsh syntax.
Operational knowledgereview due 2027-01-20
Requirementslsoflsof must be installed and available on PATH.
Version supportlsof Current supported releasesVerified for linux using posix, bash, zsh syntax; consult compatibility notes for platform-specific differences.
Expected signalsCOMMAND PID USER FD TYPE DEVICE SIZE/OFF NLINK NODE NAMERepresentative successful output; values vary with the selected target and system state.
Known errorslsof: command not foundlsof is missing or is not available on PATH.
Verifylsof +L1The output matches the expected target and exits without an error.Rollback noteNot required: this command is read-only and does not change system state.
Command breakdown
01lsofCommandRuns the lsof stage of this one-liner.
02+L1OptionConfigures lsof with the +L1 option.
Example output
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NLINK NODE NAME
java 1234 app 5w REG 8,2 1048576 0 9012 /var/log/app.log (deleted)
Illustrative output — exact values vary by system and data.
Official sources