usedfiles – executes command and prints files, used during the execution.


usedfiles [-t TMPDIR] [-a] [-k] [-s] [-f OUTCOMFILE] [-o OUTUSEDFILE] [--] CMD
usedfiles --help|--version


usedfiles prints the names of files, used by arbitrary command CMD.

Utility launches given CMD with strace(1) (mandatory version >=4.10) to track down opened and executed files, opened directories during the work of command CMD. Relying on strace(1) as data source, usedfiles thus currently works only on Linux.

CMD can be arbitrary command line with several words.

Temporary directory (/tmp/ by default) is used to store a trace during the work of target command CMD. The trace is filtered with sed(1), egrep(1), sort(1) and uniq(1) to extract file names.

By default (unless option -a is given) files from these directories are not printed:


-- token is used to separate options of usedfiles itself from target command.

Mounted file system /proc/ must be available, as strace(1) will not provide needed info in its absence. Availability of that virtual file system is checked before launch.


Print all used files regardless of their layout in filesystem, including temporary files, pids, proc entries and so on.
Temporary directory to use. /tmp/ by default.
Do not remove temporary files: unfiltered execution trace and, if -s is given, the original output of target command.
Hide the output of target command and print out only used file names. The original output is redirected to temporary file, which will be deleted automatically without -k option.
Redirect the output of target command to the given OUTCOMFILE. The file is not deleted in any way, with or without -k option.
Redirect the output, containing used files, to the given OUTUSEDFILE.
Print version and exit with 0 code.
Print short help description and exit with 0 code.


Arguments of options -t, -f and -o cannot start with '-' symbol.

See also

strace(1), sed(1)