How can you tell if a file is open in Unix?

How can you tell if a file is open in Unix?
Answer
You can run lsof command on Linux filesystem and the output identifies the owner and process information for processes using the file as shown in the following output.
  1. $ lsof /dev/null. List of All Opened Files in Linux. …
  2. $ lsof -u tecmint. List of Files Opened by User. …
  3. $ sudo lsof -i TCP:80. Find Out Process Listening Port.
 

Tìm kiếm

Back
Top