Quantcast
Viewing all articles
Browse latest Browse all 8

Answer by JShorthouse for List the files accessed by a program

For my needs this is sufficient:

strace [program] 2>&1 | grep 'openat'

For example:

$ strace sensors 2>&1 | grep 'openat'openat(AT_FDCWD, "/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3                 openat(AT_FDCWD, "/usr/lib/x86_64-linux-gnu/libsensors.so.5", O_RDONLY|O_CLOEXEC) = 3openat(AT_FDCWD, "/lib/x86_64-linux-gnu/libc.so.6", O_RDONLY|O_CLOEXEC) = 3  openat(AT_FDCWD, "/lib/x86_64-linux-gnu/libm.so.6", O_RDONLY|O_CLOEXEC) = 3  openat(AT_FDCWD, "/usr/lib/locale/locale-archive", O_RDONLY|O_CLOEXEC) = 3   openat(AT_FDCWD, "/sys/class/i2c-adapter", O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = openat(AT_FDCWD, "/sys/class/i2c-adapter/i2c-3/name", O_RDONLY) = 4  ...        

Not really sure why everyone is over-complicating this


Viewing all articles
Browse latest Browse all 8

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>