Merry Christmas & Happy 2027! Less downtime. More good times. Celebrating 13 years of sorlavit.com
Skip to content
Sorlavit KimIT Support, Network & Infrastructure Services Let’s talk

ปุ่มแปลไทยจะเปิดบทความผ่าน Google Translate เพื่อแปลอัตโนมัติ โดยคงโค้ดและคำสั่งไว้ตามต้นฉบับ

Linux Commands / IT Support Guides

Identify a file owner with lsof

An application can hold a file open after rotation or keep a port occupied after a partial shutdown. Inspect ownership before deleting files or killing processes.

Compiled for Sorlavit Kim · Published · Updated · 1 min read

Environment and inputs: Linux · Bash-compatible shell; package and service names vary by distribution

Try the diagnostic command

Use the stated shell and platform. Replace sample domains, addresses, services and paths with values from the system you are authorized to support.

lsof /var/log/app/app.log

How to read the result

The output associates the selected path with processes and file descriptors visible to your account. Missing results can reflect permissions or a different inode after rotation.

What to do next

Replace the example path and compare the process with the application's rotation or shutdown behavior. Coordinate any restart with the service owner and retest disk usage afterward.

Before you make a change

Install lsof through the approved package process if unavailable. Do not truncate an open application file without understanding the application's write behavior.

Source & further reading

Linux manual — lsof

Independently written summary reviewed on 2026-11-01. The example illustrates a possible application; it is not a client case study.

Share this article

Back to all articles