this post was submitted on 27 Aug 2023
51 points (100.0% liked)

Linux

8323 readers
213 users here now

Welcome to c/linux!

Welcome to our thriving Linux community! Whether you're a seasoned Linux enthusiast or just starting your journey, we're excited to have you here. Explore, learn, and collaborate with like-minded individuals who share a passion for open-source software and the endless possibilities it offers. Together, let's dive into the world of Linux and embrace the power of freedom, customization, and innovation. Enjoy your stay and feel free to join the vibrant discussions that await you!

Rules:

  1. Stay on topic: Posts and discussions should be related to Linux, open source software, and related technologies.

  2. Be respectful: Treat fellow community members with respect and courtesy.

  3. Quality over quantity: Share informative and thought-provoking content.

  4. No spam or self-promotion: Avoid excessive self-promotion or spamming.

  5. No NSFW adult content

  6. Follow general lemmy guidelines.

founded 2 years ago
MODERATORS
 

Is there a Linux command to monitor read and writes over a period of time? with what files were accessed and how much data was written.

top 6 comments
sorted by: hot top controversial new old
[–] Flanhare 16 points 1 year ago

iotop maybe?

[–] [email protected] 13 points 1 year ago

Iotop, lsof

They won't do exactly what you want but will get you partway there

[–] [email protected] 5 points 1 year ago

For read/write ops or disk usage over time, I would usually use a monitoring system like Prometheus and Grafana.

When you start talking about what specific files are accessed and when, that's usually up to an intrusion detection system (or IDS). I don't have good recommendations for that unfortunately.

[–] d3Xt3r 5 points 1 year ago* (last edited 1 year ago)

sysdig can monitor and display file IO usage.

See this page for some examples: https://github.com/draios/sysdig/wiki/Sysdig%20Examples#disk-io

[–] [email protected] 4 points 1 year ago

inotify-tools:

inotifywait -r -m desired/directory
[–] [email protected] 4 points 1 year ago* (last edited 1 year ago)

Something like iotop -Pao (real-time) or iotop -obd (batch) ought to do the job. I don't know if it includes writes to non-physical devices like tmpfs.

Some other commands you might find interesting: iosnoop, fatrace, pidstat, blktrace.