y-6c0w
Last Updated: February 25, 2016
·
369
· zunda
A57266327b9987be214f5ed7d145dbae

See what files are opened from a command

$ strace -o <command>.trace -e trace=file <command>
$ grep ^open <command>.trace | grep -v '= -1' | cut -d\" -f2 | sort -u
Say Thanks
Respond

2 Responses
Add your response

3023
Me aug2011

'lsof' (List Open Files) is a good choice for this task. It will show you files and ports in use.

sudo lsof | grep <command>
over 1 year ago ·
3058
A57266327b9987be214f5ed7d145dbae

Thanks! lsof is good at having a snap shot while strace is good to create a complete list :)

over 1 year ago ·
Filed Under