1

How to see which files Python is reading or editing, knowing only its PID? I did some researches but found nothing. (on a Jupyter web server running Ubuntu)

GwlanBzh
  • 9
  • 3
  • Does this answer your question? [check what files are open in Python](https://stackoverflow.com/questions/2023608/check-what-files-are-open-in-python) – l'L'l Jan 30 '20 at 21:25
  • Also: https://stackoverflow.com/a/3370694/499581 – l'L'l Jan 30 '20 at 21:26

1 Answers1

1

The lsof command shows what files a process has open.

lsof -p 123

will show the files currently opened by PID 123.

Barmar
  • 741,623
  • 53
  • 500
  • 612