Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I won't sudo the application I am using, as I do not trust it. But it is still able to read and write to the files in the /home/{username} when I run it.

How can I see what files the application is reading and writing?

share|improve this question

1 Answer 1

You can view the read() and write() calls made by an application by using strace:

strace -f -e read,write <executable>   # Launch new process, or
strace -f -e read,write -p <pid>       # Attach to existing process

You can also see what file descriptors it currently has by looking at /proc/<pid>/fd:

$ ls -l /proc/$$/fd
total 0
lrwx------ 1 chris chris 64 Dec 23 12:46 0 -> /dev/pts/3
lrwx------ 1 chris chris 64 Dec 23 12:47 1 -> /dev/pts/3
lrwx------ 1 chris chris 64 Dec 23 12:47 10 -> /dev/pts/3
lrwx------ 1 chris chris 64 Dec 23 12:47 2 -> /dev/pts/3
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.