Deleted open files

Find unlinked files still held open eating disk; df shows full but du does not

lsof +L1

tool
lsof19 commands
tags
lsofdisktroubleshootingdebug

More lsof commands

  • lsof /mnt/<name>

    Reveal processes blocking a 'device busy' umount; pass the mountpoint path

  • lsof -t -i:<port> | xargs -r kill

    Kill whatever owns a port; -t prints bare PIDs, -r avoids running kill on empty input

  • lsof -nP -i -sTCP:CLOSE_WAIT

    Spot sockets the app forgot to close; growing CLOSE_WAIT = fd/connection leak

  • lsof -nP -i @<host>:<port>

    Show only sockets talking to a specific peer host/port, both ends matched

  • lsof -p <pid> -a -d txt,mem

    Show only mapped executable and shared libs; -a ANDs the filters, great after a deploy

all 19 lsof commands