R Yoda
R Yoda

Reputation: 8750

Get pid (process ID) of R session from within R session (to attach a debugger)

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.

Upvotes: 6

Views: 956

Answers (1)

Sotos
Sotos

Reputation: 51582

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

Sys.getpid()
#[1] 134164

Upvotes: 8

Related Questions