English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

Commande screen de Linux

Linux Command大全

La commande screen de Linux est utilisée pour la gestion de fenêtres multiples.

screen est un programme de gestion de fenêtres multiples. Par fenêtre, on entend ici une fenêtre de mode texte à écran complet. Habituellement, le programme screen est utilisé uniquement lorsqu'on se connecte à un hôte via telnet ou lorsqu'on utilise un terminal ancien.

Syntaxe

screen [-AmRvx -ls -effacer]-d[nom de l'作业>]-h[nombre de lignes>]-r[nom de l'作业>]-s[nom du shell>]-S[nom de l'作业>]

Description des paramètres:

  • -A Ajuster toutes les fenêtres à la taille actuelle du terminal.

  • -d<nom de l'作业> Mettre l'作业 screen spécifiée hors ligne.

  • -h<nombre de lignes> Spécifiez le nombre de lignes du tampon de la fenêtre.

  • -m Même si l'作业 screen est déjà en cours, forcez la création d'une nouvelle tâche screen.

  • -r<nom de l'作业> Restaurer l'作业 screen hors ligne.

  • -R Tentez d'abord de restaurer les tâches hors ligne. Si vous ne trouvez pas de tâches hors ligne, créez une nouvelle tâche screen.

  • -s<shell> Specify the shell to be executed when a new window is created.

  • -S<job name> Specify the name of the screen job.

  • -v Display version information.

  • -x Restore previously offline screen jobs.

  • -ls or--list Display all current screen jobs.

  • -wipe Check all current screen jobs and delete screen jobs that cannot be used.

Online Examples

Create a screen terminal

# screen //Create a screen terminal

Create a screen terminal and execute tasks

# screen vi ~/main.c //Create a screen terminal and execute the vi command

Leave the screen terminal

# screen vi ~/main.c //Create a screen terminal and execute the vi command
#include 
main ()
{
}
"~/mail.c" 0,0-1    
Press Ctrl in the screen terminal+Press the a d keys

Reconnect to the left screen terminal

# screen -ls  //Display the created screen terminals 
There are screens on:
2433.pts-3.linux (2019year10month20 day 16hours48minutes59seconds) Detached
2428.pts-3.linux (2019year10month20 day 16hours48minute 05seconds) Detached
2284.pts-3.linux (2019year10month20 day 16hours14minutes55seconds) Detached
2276.pts-3.linux (2019year10month20 day 16hours13minutes18seconds) Detached
4 Sockets in /var/run/screen/S-root.
# screen -r 2276 //Connected to screen_id 2276 of the screen terminal

Linux Command大全