4

How can I find out the process ID of the current R session my R code is running in?

I am using Ubuntu 18.04, but an answer working on Windows would also be great.

R Yoda
  • 8,358
  • 2
  • 50
  • 87

1 Answers1

6

There is a command called Sys.getpid() that outputs the session ID directly

Sys.getpid()
#[1] 134164
Sotos
  • 51,121
  • 6
  • 32
  • 66