从R会话中获取R会话的pid(进程ID)(以附加调试器) [英] Get pid (process ID) of R session from within R session (to attach a debugger)
本文介绍了从R会话中获取R会话的pid(进程ID)(以附加调试器)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何找到我的R代码正在其中运行的当前R会话的进程ID?
How can I find out the process ID of the current R session my R code is running in?
我正在使用Ubuntu 18.04,但是在Windows上工作的答案也很好.
I am using Ubuntu 18.04, but an answer working on Windows would also be great.
推荐答案
有一个名为 Sys.getpid()
的命令,该命令直接输出会话ID
There is a command called Sys.getpid()
that outputs the session ID directly
Sys.getpid()
#[1] 134164
这篇关于从R会话中获取R会话的pid(进程ID)(以附加调试器)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文