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

Articles are written in English. The Thai translation button opens Google Translate; code and commands stay in their original form.

Linux Commands / IT Support Guides

Identify a file owner with lsof

Find which Linux process currently has a specific file open.

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

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

Understand the problem

Choose the exact file path. Use the machine on which the process runs and an account allowed to inspect it.

Run the command

Run lsof with the file path, replacing /var/log/app/app.log with the file you are checking.

lsof /var/log/app/app.log

Read the output

Read COMMAND, PID, and USER to identify the process and account. In the FD column, a value such as 4w means file descriptor 4 is open for writing.

Choose the next step

If you see a match, check whether the process belongs to the expected service. If the list is empty, verify the path and consider whether the file was closed before the check or whether permission limits what you can see.

Before making changes

Capture the process name and PID before acting. Use the service’s documented procedure for reopening or rotating its logs.

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