Reputation: 8750
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
Reputation: 51582
There is a command called Sys.getpid()
that outputs the session ID directly
Sys.getpid()
#[1] 134164
Upvotes: 8