How do you check if a file is open on Linux?

Ngọc Trâm

New member
How do you check if a file is open on Linux?
Answer
The
command lsof -t filename shows the IDs of all processes that have the particular file opened. lsof -t filename | wc -w gives you the number of processes currently accessing the file.
 

Tìm kiếm

Back
Top