I'm attempting to debug an application on Ubuntu - I need to listen to file open attempts (even for files that don't exist).

Process Monitor (formerly known as FileMon) is available on Windows - what's on Ubuntu's utility belt?



9 Answers 9


You're looking for strace. Have a look here: https://wiki.ubuntu.com/Strace

  • 2
    As I understand it, running filemon allows the user to see all file accesses. strace on the other hand, requires you to specify which app to open first. This requires you to know beforehand, the app which is accessing those files. What if you do not know which app is accessing those files that you're interested in looking at?
    – chuacw
    Oct 19, 2012 at 8:18

It depends on what you want:

  • In the large, you want to look at inotify to see all file accesses that any process makes.

  • In the small, strace will let you watch the syscalls a particular process makes. Strace is pretty awesome. You can trace a process's calls to 'open' by doing strace -f -eopen $cmd, for instance. The man page has full details on syntax, of course.

  • Thanks pjz. To be very specific - i'm having some trouble getting started with Ogre3d on Ubuntu. My test application seems to be looking for some .cfg files during start-up. I want to listen to all attempts to open files so i can ensure the correct files are available and have the correct permissions. Jul 7, 2009 at 3:59
  • strace -e open ./app
    – Justin
    Jan 23, 2010 at 0:32

strace in front of an starting application is good to watch what the app is doing.
lsof is nice to see which files an already running app is using.

lsof -ni:22 shows which process is using Port 22.


SGI has a tool that you might want to try: http://oss.sgi.com/projects/fam/

  • 2
    under linux fam is history. Really use inotify nowadays
    – ThorstenS
    Jul 7, 2009 at 10:45

Here is an example of using strace to track file changes:

strace -f -e trace=file -p7546 -o /tmp/outputfile

-f ensures that events from child processes are captured.
-e trace=file says that we should capture file-related syscalls (e.g. stat, open, futex etc.)
-p is the process ID (retrieved from ps -aux or other means) -o specified the outputfile (there may be a lot of data and you could instead use grep as a filter.


Try sysdig. For example:

sysdig -A -c echo_fds


This calls for help by Mortadelo. http://gitorious.org/mortadelo


This is old, but i think its a good idea to update it for today reality.

For debug just one process and their children, strace is still be best way. It can show easily all file acess, even on missing files.

For generic system debug, audit feature in the kernel can do that and is the recommended way. It doesnt need any patch on recent kernels, just the audit packaged installed

here is a simple gui for using it:


This replicates the windows filemon, monitoring the file acess for all places, process, etc

also check the this post


This is what worked well for me (Linux Mint 19.1):

sudo lsof 2>&1 | grep programnamehere

Not sure why 2>&1 was needed, but it didn't filter unless I used it.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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