Skip to main content
added 224 characters in body
Source Link
mpapec
  • 361
  • 1
  • 3
  • 9

From man lsof:

 FD is the File Descriptor number of the file or: <snip> FD is followed by one of these characters, describing the mode under which the file is open: <snip> The mode character is followed by one of these lock characters, describing the type of lock applied to the file: R for a read lock on the entire file; W for a write lock on the entire file; space if there is no lock. 
  • From man lsof:

     FD is the File Descriptor number of the file or: 
    FD is followed by one of these characters, describing the mode under which the file is open:
     The mode character is followed by one of these lock characters, describing the type of lock applied to the file: R for a read lock on the entire file; W for a write lock on the entire file; space if there is no lock. 

So R in 3uR mean that read/shared lock is issued by 613 PID.

#lsof /tmp/file COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME perl 613 turkish 3uR REG 8,2 0 1306357 /tmp/file 

  • Reading directly from /proc/locks is faster than lsof,

     perl -F'[:\s]+' -wlanE' BEGIN { $inode = (stat(pop))[1]; @ARGV = "/proc/locks" } say "pid:$F[4] [$_]" if $F[7] == $inode ' /tmp/file 

From man lsof:

 FD is the File Descriptor number of the file or: <snip> FD is followed by one of these characters, describing the mode under which the file is open: <snip> The mode character is followed by one of these lock characters, describing the type of lock applied to the file: R for a read lock on the entire file; W for a write lock on the entire file; space if there is no lock. 

So R in 3uR mean that read/shared lock is issued by 613 PID.

#lsof /tmp/file COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME perl 613 turkish 3uR REG 8,2 0 1306357 /tmp/file 
  • From man lsof:

     FD is the File Descriptor number of the file or: 
    FD is followed by one of these characters, describing the mode under which the file is open:
     The mode character is followed by one of these lock characters, describing the type of lock applied to the file: R for a read lock on the entire file; W for a write lock on the entire file; space if there is no lock. 

So R in 3uR mean that read/shared lock is issued by 613 PID.

#lsof /tmp/file COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME perl 613 turkish 3uR REG 8,2 0 1306357 /tmp/file 

  • Reading directly from /proc/locks is faster than lsof,

     perl -F'[:\s]+' -wlanE' BEGIN { $inode = (stat(pop))[1]; @ARGV = "/proc/locks" } say "pid:$F[4] [$_]" if $F[7] == $inode ' /tmp/file 
added 5 characters in body
Source Link
mpapec
  • 361
  • 1
  • 3
  • 9

From man lsof:

 FD is the File Descriptor number of the file or: <snip> FD is followed by one of these characters, describing the mode under which the file is open: <snip> The mode character is followed by one of these lock characters, describing the type of lock applied to the file: R for a read lock on the entire file; W for a write lock on the entire file; space if there is no lock. 

So R in 3uR mean that read/shared lock is issued by 613 PID.

#lsof /tmp/file COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME perl 613 turkish 3uR REG 8,2 0 1306357 /tmp/file 

From man lsof:

 FD is the File Descriptor number of the file or: <snip> FD is followed by one of these characters, describing the mode under which the file is open: <snip> The mode character is followed by one of these lock characters, describing the type of lock applied to the file: R for a read lock on the entire file; W for a write lock on the entire file; space if there is no lock. 

So R in 3uR mean that read/shared lock is issued by 613 PID.

#lsof /tmp/file COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME perl 613 turkish 3uR REG 8,2 0 1306357 file 

From man lsof:

 FD is the File Descriptor number of the file or: <snip> FD is followed by one of these characters, describing the mode under which the file is open: <snip> The mode character is followed by one of these lock characters, describing the type of lock applied to the file: R for a read lock on the entire file; W for a write lock on the entire file; space if there is no lock. 

So R in 3uR mean that read/shared lock is issued by 613 PID.

#lsof /tmp/file COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME perl 613 turkish 3uR REG 8,2 0 1306357 /tmp/file 
Source Link
mpapec
  • 361
  • 1
  • 3
  • 9

From man lsof:

 FD is the File Descriptor number of the file or: <snip> FD is followed by one of these characters, describing the mode under which the file is open: <snip> The mode character is followed by one of these lock characters, describing the type of lock applied to the file: R for a read lock on the entire file; W for a write lock on the entire file; space if there is no lock. 

So R in 3uR mean that read/shared lock is issued by 613 PID.

#lsof /tmp/file COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME perl 613 turkish 3uR REG 8,2 0 1306357 file