Is there a way to view or get a list of executables that a program uses?
A particular example is file-roller. Is there a way to see which executables it uses, if there is more than one executable it could use for the same task, e.g. unrar and p7zip-rar.
The program 'ldd' can be used to view the libraries a programs uses, though not in real-time. Is there an equivalent for executables, preferably in real-time? Or some other method?
Best Answer
Try starting with strace. When one program calls another, it uses one of the
exec
system calls. For instance, given the following ruby script:I can grep
strace
output to find out what executables it runs:The
-f
ensures that strace also traces child processes. At the beginning you can see the shell executing my script and the ruby interpreter. Then we can see that this script also executes /bin/ls and /bin/df. Note that this method will only show you the executables are used at run time, not all executables that might have been used if your runtime state had been different.