Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is there a way to attach to a process and find out, not only which files it is reading from, but what the read locations (byte offsets) of those reads are?

I tried using strace for this, but it doesn't seem to show that information.

share|improve this question
up vote 11 down vote accepted

you should be able to tap into /proc/$PID/fdinfo for this purpose. Check out the "The phantom progress bar" section at Solving problems with proc

fdinfo tracks a process's current position within an open file.

share|improve this answer
The "phantom progress bar" worked perfectly and was exactly what I needed :) – Roger Dahl Aug 7 '12 at 23:31

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.