Due to work environment problems, the screen command has become increasingly valuable recently. The following is a summary of the tips for using screen commands. The most commonly used parameter combination: screen-ls lists the existing screenscreen-D-R to enter the specified screen name. If not, create a screen with this name because it is often used, I put the two
Due to work environment problems, the screen command has become increasingly valuable recently. The following is a summary of the tips for using screen commands. The most common parameter combination: screen-ls // list existing screen-D-R // enter the specified screen name. If no, therefore, it is very common to create a screen with this name.
Due to work environment problems, the screen command has become increasingly valuable recently. The following is a summary of the tips for using screen commands.
The most common parameter combinations:
Screen-ls // list existing screens
Screen-D-R // enter the specified screen name. If no screen name exists, use this name to create a screen.
Since these two commands are frequently used, I have obtained the alias:
Alias sl = 'screen-ls'
Alias sr = 'screen-D-R'
In addition to commands, you can also press Ctrl + ac to create screen; Ctrl + aa to switch between two screens; Ctrl + ad to detach from screen; Ctrl + a, jump to the screen referred to by a number.
Case $ TERM in
Screen *)
# This is the escape sequence ESC k \ w ESC
# Use current dir as the title
SCREENTITLE = '\ [\ ek \ W \ e \]'
PS1 = "$ {SCREENTITLE }$ {PS1 }"
;;
*)
;;
Esac
Then, modify the screen configuration file, add the status bar, and add the following in. screenrc:
Caption always '% {= B cw} %-w % {= rb db} %> % n % t % {-} % + w % {-B} % <% {= kG} %-= % D % c % {-}'
Shelltitle '$ | bash'
The final result is: