O comando "screen"






Olá, quantas vezes você já se defrontou no Linux em rodar um processo, reindexar uma base de dados entre outros processos mas está na hora de ir embora e você precisa fechar a sessão? 

Então, o Linux oferece um comando muito importante e interessante para este tipo de de operação, este comando é o "screen". Como de sempre vou direto ao assunto:

#Instalando o screen:
apt-get install -y screen

#Utilizando o comando: para executar o programa digite o bash "screen" e de enter, depois clique na tecla de espaço para continuar.

Screen version 4.00.03jw4 (FAU) 2-May-06

Copyright (c) 1993-2002 Juergen Weigert, Michael Schroeder
Copyright (c) 1987 Oliver Laumann

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software
Foundation; either version 2, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program (see the file COPYING); if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.

Send bugreports, fixes, enhancements, t-shirts, money, beer & pizza to screen@uni-erlangen.de


                                                              [Press Space or Return to end.]

Dentro do screen:





Para criar nova sessão: digite CTRL+A c 

Navegar entre sessões: 

digite CTRL +A n (próxima sessão)
digite CTRL +A p (sessão anterior)
digite CTRL +A (numero da sessão) 

Sair sem fechar a sessão: CTRL +A d (desvincular)

Para voltar a sessão desvinculada digite:
#screen -r

É uma ótima alternativa para rodar processos sem fechar a conexão. Exemplo uma rotina onde quero procurar em um arquivo de texto de 1GB uma string (mas tenho que ir buscar a neném na escola, rs).

Att Junior.

Comentários

Postagens mais visitadas