#!/usr/local/bin/python3 import subprocess; subprocess.check_output(['lsof', '-wXFn', '+p', str(pid) for pid in set(subprocess.check_output(['lsof', '+wt']+list(files), stderr=DEVNULL)], stderr=DEVNULL)