Because of the second-generation sequencing analysis, it is often necessary to run programs for a long time. Because of the long time, there has been no good way. When you have screen, all this is solved. Typing the command screen creates a single window running the shell, where you can run the program you need.
Using screen is very easy. Just type screen in SHELL to open a screen session.
And under each screen session, all commands start with ctrl+a(C-a). Now let me briefly introduce the basic command C-ac->Create, open a new window
C-an->Next, switch to the next window
C-ap- >Previous, previous window
more..
less..C-aC-a->Other, switch between two windows
C-aw -> Windows, list the windows that have been opened.
C-a0->Switch to the 0th window
C-a1..9->Switch to the 1st ..9 windowC-aa-> issued Ca, in emacs, ve, bash, tcsh can be moved to the beginning of the C-at-> Time, display the current time, and the system load
C -aK (uppercase)->killwindow, forcibly close the current windowC-a[-> enter copy mode, in the copy mode you can roll back, search,
copy is like using vi as C- bBackward, PageUp
C-fForward, PageDown
H (uppercase) High, move the cursor to the upper left corner
LLow, move the cursor to the lower left corner
0 moves to the beginning of the line
$row of the line
In normal mode:
Use screen-ls to see all the sc Reen sessions
Use screen-rsessionid to enter the specific screensession specified by sessionid
Finally exit exit.
--------------------------------
In addition, everyone is in the background service , or when executing a script for a long time. Is it feeling that the interaction is very poor,
Sometimes, I want to output the result directly on the terminal, and I am afraid that the terminal is closed accidentally and the process exits. (Some sshd services will also set the connection timeout, automatically exit the terminal)
Now use the screen command to solve the problem of running the background service.
The command is super simple:
Enter screen directly on the terminal. At this time, the server will open a new terminal, but this terminal is different from the previous ordinary terminal. It is not affiliated with the sshd process group, so that when the local terminal is closed, the server terminal will not be killed.
Of course, the advantages are not limited to this. When you perform tasks in the server terminal, you can even switch to the local terminal to do other things at any time. Then, when you go back, you can restore to the server you just opened. In the terminal, if the task just did not end, you can continue to perform the task.
Operation steps:
First, enter the screen-Ssessionname terminal. (sessionname is to distinguish your session)
Then press ctrl+a, then press d to temporarily exit the terminal.
When you want to return, first check the terminal process ID, screen-list
or directly
screen-rxx (just the sessionname).
Of course, when you open a lot of sessions, you plan to close several sessions, you can enter the session, exit it.
In general, screen can completely replace nohup And it provides more complicated features, but I think that the simple functions just enough to handle daily operations.
Summary:
I hope that the powerful screen command in the Linux system described in this article can help the reader. More knowledge about the Linux system remains to be explored and learned by the reader.
ifconfig -a View all NIC information of Linuxifconfig eth0 down Turn off eth0 network cardifconfig e
lftp is an ftp client under Linux for logging in to a remote FTP server. Use its mirror command to b
How do I use a USB-based storage device in a Linux environment? This
This article mainly introduces the DB2 database in the inux installation process detailed, the step
Wrong way to modify linux system file permissions
Ten collection systems and hardware information commands under Linux tutorial
30 questions that must be mastered by embedded system Linux kernel development engineers
Set up a personal Bluetooth LAN under Linux
Linux environment variables (2)
Background daemon under Linux system
Linux command line knowledge: apropos command parameters and usage introduction
How to close uac? Win8.1 close uac operation method
What if Win10 can't adjust the volume?
Let the drive letter remain unchanged for
How to quickly search for a picture with the suffix named jpg in the Win7 system
After Win7 starts, the hard disk light flashes without reading the sound solution.
Win8 how to share the printer Win8 add shared printer method
Windows 7 migration problem Is it a challenge or an opportunity?
Shield Win10 upgrade notification pop-up tool release the latest version