2017年5月27日 星期六

[Linux 常見問題] How to assign name for a screen?

Source From Here
Question
I'm using the screen multiplexer tool on the command shell and open a lot of screens. I then forget which process ID associates with which task. I would like to set a name for a screen but can't find an option in the manpage.

Currently, listing the screens looks like this:
  1. There are screens on:  
  2.     5422.pts-1.aws1 (Detached)  
  3.     5448.pts-1.aws1 (Detached)  
  4.     5027.pts-1.aws1 (Detached)  
  5. 3 Sockets in /var/run/screen/S-sb.  
And I would like to see something like this:
  1. There are screens on:  
  2.     5422.logCleanWorker (Detached)  
  3.     5448.overNightLongTask(Detached)  
  4.     5027.databaseOverNightLongTask (Detached)  
  5. 3 Sockets in /var/run/screen/S-sb.  

How can I do this?

How-To
To create a new screen with the name foo, use
// -S sessionname: When creating a new session, this option can be used to specify a meaningful name for the session.
# screen -S foo

Then to reattach it, run
// -r sessionowner/[pid.tty.host]: resumes a detached screen session.
# screen -r foo # or use -x, as in
# screen -x foo # for "Multi display mode" (see the man page)


沒有留言:

張貼留言

[Git 常見問題] error: The following untracked working tree files would be overwritten by merge

  Source From  Here 方案1: // x -----删除忽略文件已经对 git 来说不识别的文件 // d -----删除未被添加到 git 的路径中的文件 // f -----强制运行 #   git clean -d -fx 方案2: 今天在服务器上  gi...