Lsof offset of large reading files

From Luniwiki
Jump to: navigation, search

Command

Option -o in lsof provides the offset in hexadecimal. If we read this value and we convert it to decimal, we know the offset in the file that the process is reading.

 lsof -o <FILE> 2>/dev/null | grep x | awk '{print "ibase=16; " toupper(substr($7,3)) }' | bc

References