Skip to content

Instantly share code, notes, and snippets.

@chris-peterson
Created March 31, 2022 19:40
Show Gist options
  • Save chris-peterson/e1988c4d2e7a5bd8d3a676bc56966ea8 to your computer and use it in GitHub Desktop.
Save chris-peterson/e1988c4d2e7a5bd8d3a676bc56966ea8 to your computer and use it in GitHub Desktop.
get working directory for arbitrary PID
lsof -a -p <PID> -d cwd -F n | grep '^n' | sed 's/^n//'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment