I believe since you do not know the file name/process id, you could specify user name option as below.

lsof -r 2 -u username
  • The “-r 2” option puts lsof in repeat mode, with updates every 2 seconds. (Ctrl -c quits)
  • The “-u’ option can be used to keep an eye on a users activity.

If you know the directory name under which the application is being run and do not want to specify the user name,you could use the command like,

lsof +D /some/dir -r 2 
# how many open files does user "username" have?
lsof -u username | awk '{print $9}' | sort | uniq | wc -l

alternatively: Java application

https://sourceforge.net/projects/glsof/

src:
https://unix.stackexchange.com/questions/157064/monitoring-files-continuously-with-lsof

liked this article?

  • only together we can create a truly free world
  • plz support dwaves to keep it up & running!
  • (yes the info on the internet is (mostly) free but beer is still not free (still have to work on that))
  • really really hate advertisement
  • contribute: whenever a solution was found, blog about it for others to find!
  • talk about, recommend & link to this blog and articles
  • thanks to all who contribute!
admin