See what files are being written to (like iotop but for files, not processes)

23,451

Solution 1

lsof may help if you know the process you want to watch:

lsof -p <pid> -r 5

-r is the number of seconds between checks.

Solution 2

You can use sysdig:

sudo apt-get install sysdig;
sysdig -c topfiles_bytes;

There's also an interactive (top-like) terminal program that might be useful in your case.

csysdig;
Share:
23,451

Related videos on Youtube

Araejay
Author by

Araejay

Updated on September 17, 2022

Comments

  • Araejay
    Araejay over 1 year

    I have a Linux server, and it's doing a lot of disk io. There is one process that is doing most of the disk writes. I found this out with iotop, which shows the processes that are doing disk I/O. Is there an equivant programme (in the debian lenny apt repositories) that will show me what files are being written to? a 'top' like interface would be great? Is this even possible?

  • Araejay
    Araejay over 13 years
    that'll show me what files are being written, is there any way to see how much data is being written?
  • Cakemox
    Cakemox over 13 years
    I am not aware of a tool which does both, so in the meantime you may just want to watch the files (once identified with lsof) with du over some period of time to see the changes.
  • Valerio Bozzolan
    Valerio Bozzolan about 3 years
    This is not available anymore in Debian buster.
  • alchemy
    alchemy over 2 years
    This is awesome! apt install sysdig works 2021-11.. command: csysdig
  • Admin
    Admin almost 2 years
    I was able to use on buster by downloading package from github.com/draios/sysdig/releases/tag/0.29.3