Finding the file that's modified when you run a terminal command? I want to know what file is modified when I run a terminal command like:

 osascript -e "set Volume 0.5"


Is there a way to do this? I'm thinking maybe a command that looks for recently modified files in setting directories.
In general, you can use ‘opensnoop’ which will list files being accessed in realtime. You'll need to disable SIP to use this command.

sudo opensnoop


To use opensnoop on a specific process such as osascript, use

sudo opensnoop -n osascript


For that specific command, no file is modified. It's setting the current volume, that's all.