If you want to see exactly what files your Mac is monkeying with at any given moment for a given process, open a terminal and do this:
sudo fs_usage -w -f filesys mdworker | egrep "open"
I used that to determine if Spotlight was actually indexing what I told it to, but it could be useful for a wide variety of troubleshooting.
That will not work on Linux. For Linux, something like this would do something similar, though there is no single utility available on Linux that is as versatile or useful as “fs_usage:”
sudo lsof -p 2075
Where “2075” is the PID number.
The utility “strace” might work, too.
Also, “fs_usage” can be run without specifying a process, but that is probably not a good idea as the output will be vast.
The reason I like using a Mac vs. Linux or Windows apart from how vastly better the Mac handles hi-dpi and mixed dpi is that in Linux and Windows, you can usually find something that works…sort of. On the Mac, you can usually find the one tool that works perfectly.
That has mattered more to me as I’ve gotten older.