📄 screen.html
字号:
<html><title>Using the screen program</title><body bgcolor="#FFFFFF" text="#000000" link="#0000AA" alink="#0000FF" vlink="#000044"><h2 align=center>Using the screen program</h2><p>The "screen" program can be used whenever you want to log out of a remoteLinux account, but you want another program that you are running (in our case,Avida) to keep running even after you've logged out. You may not need to usethis immediately, but its good to know that its available. Screen isbasically a virtual terminal -- you start it up, and it looks like the sameterminal as before, but now you can "detach" it and "resume" it later. Thisis best shown by a demonstration.<h3>Screen Walkthrough</h3><p>To start the screen program, simply type<p> <tt>screen</tt><p>from the command line. Youshould see your command line prompt appear on a nice empty screen. Next,go into your avida work directory and start a run. If you put avida inyour home directory, you would type:<p> <tt>cd ~/avida/current/work/</tt><br> <tt>primitive</tt><br><p>Now once the run is going, you want to detach it. Screen interceptsCTRL-A whenever you press it, and waits for the next keystroke to find outwhat it should do. Watch out because this may be confusing if you are usinganother program that you intended the CTRL-A to affect. In any case, todetach the screen, you should press CTRL-A followed by the lowercase letter'd'. (note that you press one, and then the other, not all at once).<p> <tt>[CTRL-A] d</tt><br><p>The avida run should disappear, and you should be back at the commandline where you first ran screen, and now it will say "<tt>[detached]</tt>"at the bottom of the screen.<p>You can even log out and log back in now if you like. Whenever you are ready to get back to your avida run, from the command line, type:<p> <tt>screen -r</tt><br><p>This tells screen to resume where it left off before. Notice that updateshave continued to go by in Avida while you weren't connected.<p>There are two ways of issuing commands to screen. The first, we've alreadyexplained -- when you are in screen, you simply press CTRL-A and then thekey that corresponds to the command you wish screen to perform. The secondway is when you're not in screen. Then you need to type "<tt>screen</tt>"followed by a dash ('-') and the letter that corresponds to the command.<p>For example, imagine that I start up an avida run in a screen session, butI forgot to detach it before I went home. Now that I'm home, I want tosee how my avida run is going. What I can do is log onto the remote Linuxmachine from home, type "<tt>screen -d</tt>" at the command line, andmy screen session running elsewhere one that remote screen will detach. Ican now type "<tt>screen -r</tt>" from where I am, and I'll be backin my screen session.<p>This explanation just touches on some of the abilities of screen. Inpractice, I tend to run a screen session an do much of my work in it. Thenwhen I want to work somewhere else, I don't have to setup everything all over again -- I resume my screen session and I'm already right where I leftoff.<p>Below, I will go into some of the other abilities of screen.<h3>Screen Command Summary</h3><p>Below is a list of commands that you can issue from within screen. PressCTRL-A and then the corresponding command key to get the effect.<p><table cellpadding=5><tr><th>d <td>Detach the current screen session<tr><th>c <td>Create a new screen session. This new session will give you a brand new command line. You can have up to 10 screen session at a time.<tr><th>[SPACE] <td>Toggle between screen sessions.<tr><th>k <td>Kill the current screen session (but leave the rest running)<tr><th>? <td>Get a list of all possible screen commands.</table><p>If you want to get to the official documentation that comes with screen,you should go to the command line and type:<p> <tt>info screen</tt><br><p>You can then use the arrow keys to move the cursor around on the screen, andpress enter on a link to obtain more information on a topic.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -