Track deleted (but open) file usage

From time to time the du command doesn’t match up with df. This is due to deleted files that are still held open by a process. You can total the deleted but ‘still open’ file usage:

lsof | awk '/deleted/ {sum+=$7} END {print sum}'

Or, to simply list all the files and their processes:

lsof | grep deleted

Comments are closed.