30 nov. 2015

Appréhender GNU screen en 5 minutes

Définition de wikipedia:
GNU Screen is a software application that can be used to multiplex several virtual consoles, allowing a user to access multiple separate terminal sessions inside a single terminal window or remote terminal session. It is useful for dealing with multiple programs from a command line interface, and for separating programs from the Unix shell that started the program. (https://en.wikipedia.org/wiki/GNU_Screen)

Je pars du principe que l'on est sous Debian ou Ubuntu.

Installer screen
# apt-get install screen
 Ouvrir une session screen:
# screen -S download_ubuntu

par exemple, dans mon cas, je veux lancer le téléchargement d'une ISO
# wget http://releases.ubuntu.com/15.10/ubuntu-15.10-server-amd64.iso
--2015-11-30 15:38:33--  http://releases.ubuntu.com/15.10/ubuntu-15.10-server-amd64.iso
Connecting to 10.49.64.5:8080... connected.
Proxy request sent, awaiting response... 200 OK
Length: 662700032 (632M) [application/x-iso9660-image]
Saving to: ‘ubuntu-15.10-server-amd64.iso’

 0% [                                                                                                                            ] 3 461 854    576KB/s  eta 18m 29s
Laisser courir le téléchargement
Taper simultanément [CTRL] + a puis d

[detached from 5049.download_ubuntu]
Lister les sessions screen actives:
# screen -ls
There are screens on:
        5049.download_ubuntu    (30/11/2015 15:38:01)   (Detached)
        5019.1  (30/11/2015 15:33:47)   (Detached)
2 Sockets in /var/run/screen/S-root.

Reprendre la session "download_ubuntu"
# screen -r 5049.download_ubuntu

Aller plus loin avec screen :

# man screen
https://www.gnu.org/software/screen/manual/screen.html

http://aperiodic.net/screen/quick_reference

http://web.mit.edu/gnu/doc/html/screen_13.html

Aucun commentaire:

Enregistrer un commentaire