我正在Linux服务器上运行一个长脚本。为了避免因为不活动而被踢开,我使用了screen来确保脚本运行到终止。现在已经有几个小时了,我想知道屏幕到底激活了多长时间。我用screen -S fragmentation ./fragment-all.sh启动屏幕的命令。我没有根特权。
yangsong@lanikai ~ $ screen -ls
There is a screen on:
852342.fragmentation (Detached)
1 Socket in /tmp/screen/S-yangsong.发布于 2021-06-11 17:25:13
pgrep screen运行的屏幕命令的进程id。(进程grep屏幕)。如果无法通过此命令找到屏幕进程,则可以使用id).命令查看正在运行的所有进程,并使用自己的PID查找屏幕进程(process
ps -o etime= -p "PID"来查看进程运行的时间。使用从[[dd-]hh:]mm:ss.命令获得的进程id更改
kill PID。使用要terminate.的进程id更改
我更喜欢的
ps -o stime,time PIDhttps://stackoverflow.com/questions/67940932
复制相似问题