Утилита screen в linux
screen
Переключиться из сессии screen на основную:
Ctrl+a d
Если открыта одна сессия screen, вернуться к ней можно с помощью команды:
# screen -r
Проверить список сессий screen:
# screen -list
Или
# screen -ls
Если сессий несколько, можно получить ID сессии и подключиться к нужной:
# screen -x ID Или # screen -r ID
Если вы запускаете несколько сессий screen, то можно задать имя сессии.
# screen -S rsync
- Создать новое окно:
Ctrl+a c - Перейти к следующем окну:
Ctrl+a n - Перейти к предыдущему окну:
Ctrl+a p - Изменить имя окна:
Ctrl+a a
Запуск с параметрами
screen [OPTIONS] [ CMD [ ARGS ] ]
https://wiki.merionet.ru/servernye-resheniya/40/kak-polzovatsya-utilitoj-screen-v-linux/
Ctrl+a и c - создать дополнительное окно ;
Ctrl+a и " - показать список всех имеющихся окон;
Ctrl+a и 0 - переключиться на окно с номером 0 (номер может быть иной);
Ctrl+a и A - переименовать текущее окно;
Ctrl+a и S - разделить окно по горизонтали на две области;
Ctrl+a и | - разделить окно по вертикали на две области;
Ctrl+a и tab - переключить рабочий фокус на следующую область разделенного окна;
Ctrl+a и Ctrl+a - переключить рабочий фокус на предыдущую область разделенного окна;
Ctrl+a и Q - закрыть все разделенные области кроме;
Ctrl+a и X - закрыть текущую область;
КАСТОМИЗАЦИИ SCREEN
Когда screen запускается, он считывает свои конфигурационные параметры из /etc/screenrc и ~/.screenrc, если файл присутствует. Так вот - мы можем легко перенастроить предпочтения использования screen и сделать это в файле .screenrc.
Посмотрите пример с комментариями, как мы закастомили screen для себя:
# Выключаем приветствие
startup_message off
# выключаем визуальный звонок
vbell off
# буфер для сохраненных строк делаем 10000
defscrollback 10000
# кастомим строку состояния
hardstatus alwayslastline
hardstatus string '%{= kG}[ %{G}%H %{g}][%= %{= kw}%?%-Lw%?%{r}(%{W}%n*%f%t%?(%u)%?%{r})%{w}%?%+Lw%?%?%= %{g}][%{B} %m-%d %{W}%c %{g}]'https://www.tecmint.com/screen-command-examples-to-manage-linux-terminals/
17. Enable Screen Logging in Linux
Sometimes it is important to record what you have done while you are in the console. Let’s say you are a Linux Administrator who manages a lot of Linux servers.
With this screen logging, you don’t need to write down every single command that you have done. To activate the screen logging function, just press “Ctrl-A” and “H“. (Please be careful, we use a capital ‘H’ letters. Using non-capital ‘h’, will only create a screenshot of the screen in another file named hardcopy).
At the bottom left of the screen, there will be a notification that tells you to like: Creating logfile “screenlog.0“. You will find a screenlog.0 file in your home directory.
This feature will append everything you do while you are in the screen window. To close the screen to log running activity, press “Ctrl-A” and “H” again.
Another way to activate the logging feature, you can add the parameter “-L” when the first time running the screen. The command will be like this.
https://www.shellhacks.com/screen-scroll-up-scrollback-buffer/
You can also disable the alternate scrollback buffer by adding the following line to your ~/.screenrc file:
# Enable scrolling termcapinfo xterm* ti@:te@
When disabled you can scroll up and down in a normal way while running the screen command using the scroll bar or the mouse wheel as well as PageUp▲ and PageDown▼ keys.
Note, that this will work for the new screen sessions only.
Ссылки:
https://wiki.merionet.ru/servernye-resheniya/40/kak-polzovatsya-utilitoj-screen-v-linux/
https://winitpro.ru/index.php/2021/02/05/ispolzovanie-utility-screen-v-linux/
https://linuxize.com/post/how-to-use-linux-screen/
https://www.tecmint.com/screen-command-examples-to-manage-linux-terminals/
https://www.shellhacks.com/screen-scroll-up-scrollback-buffer/
Комментарии
Отправить комментарий