GNU Screen a Terminal Multiplexer

Total Page:16

File Type:pdf, Size:1020Kb

GNU Screen a Terminal Multiplexer GNU Screen A Terminal Multiplexer Sebastian Panknin Institut of Physics Humboldt University of Berlin 2008-08-19 / IceTray Seminar Sebastian Panknin (Humboldt University) GNU Screen IceTray Seminar 1 / 11 Outline 1 Motivation 2 A Basic Session 3 Srolling and Logging 4 Windows 5 Advanced Sessions Sebastian Panknin (Humboldt University) GNU Screen IceTray Seminar 2 / 11 The Problem People like to do heavy calculations on their working computers but like to log in from home. Working at different computers can be annoying not all processes can be put in background (problem with IO) you want to log out, but your job wants to run for another 30 hours working from home/airport/conference location tomorrow Also would be nice Is there somewhere the word “Foo” in the 500 lines output? I have forgotten to pipe it in a file. Can I share a shell session with an expert? The solution: GNU Screen Sebastian Panknin (Humboldt University) GNU Screen IceTray Seminar 3 / 11 Simple Use Case Basic Session First starting Screen: When you have screen started a screen do what ever you want in the shell session, you can detach from screen with C-a d leave it and resume Later (maybe from a new shell over ssh): it whenever you want. Programs reopen screen with screen -r running in the screen do what ever you want in the shell won’t notice. detach again, . Screen ends if you exit the shell. Sebastian Panknin (Humboldt University) GNU Screen IceTray Seminar 4 / 11 Basic Session Commands I don’t want to listen to the talk, so where is more information available? Screen Help man page: man screen info page: info screen on-line help inside screen: C-a ? Good to know analogous for the confusing C-s: C-a s – use C-a q to make it going again. list of open screen sessions: screen -list connect to a specific session: screen -r pid.tty.host Sebastian Panknin (Humboldt University) GNU Screen IceTray Seminar 5 / 11 The Scroll Buffer Starting the “Copying and Scroll Mode” with C-a [ Movements cursor keys Vi like movement keys C-u and C-d scrolls up and down Searching Vi forward search / and backward ? incremental forward C-a s and backward: C-r Exit with ESC Sebastian Panknin (Humboldt University) GNU Screen IceTray Seminar 6 / 11 Logging Forgotten to pipe the output into a file? – Screen helps: If you found something interesting in the scroll back buffer make a hard copy or if you hope for something interesting turn the logging on. Start/stop logging of current window: C-a H Save window content in a file: C-a : hardcopy -h filename Time stamps: C-a : logtstamp toggles the time stamp state. If it is on, a time stamp is written if the program gets inactive. Sebastian Panknin (Humboldt University) GNU Screen IceTray Seminar 7 / 11 Window Management Opening many ssh-connections is annoying, but having only one shell is Switching Windows unpractical, too. – Screen allows many to specific window: C-a shells over one connection. 0 ... C-a 9 next/previous: C-a n create a new window with C-a c resp. C-a p window list: C-a " to the last used: C-a windows close by exit of the shell C-a Sebastian Panknin (Humboldt University) GNU Screen IceTray Seminar 8 / 11 Fancy Window Stuff Displaying Several Windows at One Time Split the display with C-a S. The new region shows a blank window. cycle through the regions: C-a TAB remove current region: C-a X only one region again: C-a Q Monitoring A message can be displayed if a output starts/stops in a hidden window. activity monitoring: C-a M inactivity monitoring: C-a Sebastian Panknin (Humboldt University) GNU Screen IceTray Seminar 9 / 11 Using Multiple Sessions Sometime one runs multiple screen sessions. detach session: screen -d pid.sessionname reattach session: screen -r pid.sessionname powerful combination reattach and if needed detach fist: screen -d -r also create a session if needed: screen -d -R as above but take the first session: screen -d -RR attach an attached session without detaching: screen -xR Sebastian Panknin (Humboldt University) GNU Screen IceTray Seminar 10 / 11 Summary Screen is useful for running programs in background, access a running program from different locations, logging and searching in command output. It also supports I window management I multiuser sessions. Sebastian Panknin (Humboldt University) GNU Screen IceTray Seminar 11 / 11.
Recommended publications
  • Freenas® 11.0 User Guide
    FreeNAS® 11.0 User Guide June 2017 Edition FreeNAS® IS © 2011-2017 iXsystems FreeNAS® AND THE FreeNAS® LOGO ARE REGISTERED TRADEMARKS OF iXsystems FreeBSD® IS A REGISTERED TRADEMARK OF THE FreeBSD Foundation WRITTEN BY USERS OF THE FreeNAS® network-attached STORAGE OPERATING system. VERSION 11.0 CopYRIGHT © 2011-2017 iXsystems (https://www.ixsystems.com/) CONTENTS WELCOME....................................................1 TYPOGRAPHIC Conventions...........................................2 1 INTRODUCTION 3 1.1 NeW FeaturES IN 11.0..........................................3 1.2 HarDWARE Recommendations.....................................4 1.2.1 RAM...............................................5 1.2.2 The OperATING System DeVICE.................................5 1.2.3 StorAGE Disks AND ContrOLLERS.................................6 1.2.4 Network INTERFACES.......................................7 1.3 Getting Started WITH ZFS........................................8 2 INSTALLING AND UpgrADING 9 2.1 Getting FreeNAS® ............................................9 2.2 PrEPARING THE Media.......................................... 10 2.2.1 On FreeBSD OR Linux...................................... 10 2.2.2 On WindoWS.......................................... 11 2.2.3 On OS X............................................. 11 2.3 Performing THE INSTALLATION....................................... 12 2.4 INSTALLATION TROUBLESHOOTING...................................... 18 2.5 UpgrADING................................................ 19 2.5.1 Caveats:............................................
    [Show full text]
  • Linux on the Road
    Linux on the Road Linux with Laptops, Notebooks, PDAs, Mobile Phones and Other Portable Devices Werner Heuser <wehe[AT]tuxmobil.org> Linux Mobile Edition Edition Version 3.22 TuxMobil Berlin Copyright © 2000-2011 Werner Heuser 2011-12-12 Revision History Revision 3.22 2011-12-12 Revised by: wh The address of the opensuse-mobile mailing list has been added, a section power management for graphics cards has been added, a short description of Intel's LinuxPowerTop project has been added, all references to Suspend2 have been changed to TuxOnIce, links to OpenSync and Funambol syncronization packages have been added, some notes about SSDs have been added, many URLs have been checked and some minor improvements have been made. Revision 3.21 2005-11-14 Revised by: wh Some more typos have been fixed. Revision 3.20 2005-11-14 Revised by: wh Some typos have been fixed. Revision 3.19 2005-11-14 Revised by: wh A link to keytouch has been added, minor changes have been made. Revision 3.18 2005-10-10 Revised by: wh Some URLs have been updated, spelling has been corrected, minor changes have been made. Revision 3.17.1 2005-09-28 Revised by: sh A technical and a language review have been performed by Sebastian Henschel. Numerous bugs have been fixed and many URLs have been updated. Revision 3.17 2005-08-28 Revised by: wh Some more tools added to external monitor/projector section, link to Zaurus Development with Damn Small Linux added to cross-compile section, some additions about acoustic management for hard disks added, references to X.org added to X11 sections, link to laptop-mode-tools added, some URLs updated, spelling cleaned, minor changes.
    [Show full text]
  • Cygwin User's Guide
    Cygwin User’s Guide Cygwin User’s Guide ii Copyright © Cygwin authors Permission is granted to make and distribute verbatim copies of this documentation provided the copyright notice and this per- mission notice are preserved on all copies. Permission is granted to copy and distribute modified versions of this documentation under the conditions for verbatim copying, provided that the entire resulting derived work is distributed under the terms of a permission notice identical to this one. Permission is granted to copy and distribute translations of this documentation into another language, under the above conditions for modified versions, except that this permission notice may be stated in a translation approved by the Free Software Foundation. Cygwin User’s Guide iii Contents 1 Cygwin Overview 1 1.1 What is it? . .1 1.2 Quick Start Guide for those more experienced with Windows . .1 1.3 Quick Start Guide for those more experienced with UNIX . .1 1.4 Are the Cygwin tools free software? . .2 1.5 A brief history of the Cygwin project . .2 1.6 Highlights of Cygwin Functionality . .3 1.6.1 Introduction . .3 1.6.2 Permissions and Security . .3 1.6.3 File Access . .3 1.6.4 Text Mode vs. Binary Mode . .4 1.6.5 ANSI C Library . .4 1.6.6 Process Creation . .5 1.6.6.1 Problems with process creation . .5 1.6.7 Signals . .6 1.6.8 Sockets . .6 1.6.9 Select . .7 1.7 What’s new and what changed in Cygwin . .7 1.7.1 What’s new and what changed in 3.2 .
    [Show full text]
  • The Elinks Manual the Elinks Manual Table of Contents Preface
    The ELinks Manual The ELinks Manual Table of Contents Preface.......................................................................................................................................................ix 1. Getting ELinks up and running...........................................................................................................1 1.1. Building and Installing ELinks...................................................................................................1 1.2. Requirements..............................................................................................................................1 1.3. Recommended Libraries and Programs......................................................................................1 1.4. Further reading............................................................................................................................2 1.5. Tips to obtain a very small static elinks binary...........................................................................2 1.6. ECMAScript support?!...............................................................................................................4 1.6.1. Ok, so how to get the ECMAScript support working?...................................................4 1.6.2. The ECMAScript support is buggy! Shall I blame Mozilla people?..............................6 1.6.3. Now, I would still like NJS or a new JS engine from scratch. .....................................6 1.7. Feature configuration file (features.conf).............................................................................7
    [Show full text]
  • Upgrade Operations Guide
    Oracle® Communications Network Charging and Control Upgrade Operations Guide Release 12.0.2 December 2018 Copyright Copyright © 2018, Oracle and/or its affiliates. All rights reserved. This software and related documentation are provided under a license agreement containing restrictions on use and disclosure and are protected by intellectual property laws. Except as expressly permitted in your license agreement or allowed by law, you may not use, copy, reproduce, translate, broadcast, modify, license, transmit, distribute, exhibit, perform, publish, or display any part, in any form, or by any means. Reverse engineering, disassembly, or decompilation of this software, unless required by law for interoperability, is prohibited. The information contained herein is subject to change without notice and is not warranted to be error- free. If you find any errors, please report them to us in writing. If this is software or related documentation that is delivered to the U.S. Government or anyone licensing it on behalf of the U.S. Government, then the following notice is applicable: U.S. GOVERNMENT END USERS: Oracle programs, including any operating system, integrated software, any programs installed on the hardware, and/or documentation, delivered to U.S. Government end users are "commercial computer software" pursuant to the applicable Federal Acquisition Regulation and agency-specific supplemental regulations. As such, use, duplication, disclosure, modification, and adaptation of the programs, including any operating system, integrated software, any programs installed on the hardware, and/or documentation, shall be subject to license terms and license restrictions applicable to the programs. No other rights are granted to the U.S. Government.
    [Show full text]
  • A Quick and Easy Guide to Tmux
    7/24/2018 A Quick and Easy Guide to tmux Ham Vocke writing stu about software (/) Home (/) Blog (/blog) About Me (/about) Talks (/talks) (https://github.com/hamvocke) (https://twitter.com/hamvocke) (http://www.hamvocke.com/feed.xml) A Quick and Easy Guide to tmux 16 Aug 2015 terminal 13 minutes read I love working with the command line. Seriously, I think there’s hardly any more productive and more versatile tool for a software developer than the terminal. Maybe it’s the hacker/wizard/neckbeard kind of feeling I get when using a terminal, I don’t know. At work we do lots of pair programming. Everyone’s got their own laptop and can set it up the way they like. And since I love working with the command line I’ve spent quite some time doing (only sane! I swear!) modications to my terminal environment that make working with the command line more pleasant and streamlined. This is why my pair usually will be greeted by something like this: https://www.hamvocke.com/blog/a-quick-and-easy-guide-to-tmux/ 1/21 7/24/2018 A Quick and Easy Guide to tmux If they’ve worked with me before they know what they are up to. But every once in a while there will be a new team member who doesn’t know my environment. Usually this is the point where they will ask something like “WTF am I looking at?” and it’s my time to shine! Because what they’re looking at is nothing less than the best thing since sliced bread.
    [Show full text]
  • Tmux: Terminal Multiplexer
    tmux: Terminal Multiplexer Tom Ryder [email protected] https://sanctum.geek.nz/ What is tmux? ● tmux is a terminal multiplexer. ● Runs in the TTY, or your favourite terminal emulator ● Start any number of virtual terminals within it ● Arrange terminals in any way you like ● And most importantly: Attach/detach without interrupting running programs ● Extremely useful for sysadmin work where X is unavailable, and many other things Simple use case ● You SSH in to your faraway server. ● You start a process interactively, that you think will only take a few minutes... – ...but it takes ages! – ...and you forgot to redirect the output to a file! – ...and interrupting the process will break things! – ...and your laptop is running out of battery! ● What to do? Simple use case ● The shell way: Bash: $ long-running-job [Ctrl-Z] to suspend $ bg $ disown $ logout Still works, and useful to remember in a pinch! ● Lets the process complete safely, but... ● ...you lose all the output, and you can’t (easily) “adopt” the process again. ● Your job has a dependency on your SSH connection. ● If only we could fix that... Simple use case ● The multiplexer way: tmux: $ tmux $ long-running-job [Ctrl-B, d] to detach $ logout ● And then later: $ ssh yourhost $ tmux attach ● And your job’s output is sitting there, like you never left. Another use case ● You run a program like Mutt on a server to read and write mail ● Your connection is flaky ● Every time your SSH connection cuts, you completely lose the message you were writing, or your place in the mail queue
    [Show full text]
  • GNU Screen Cheat Sheet by Mynocksonmyfalcon Via Cheatography.Com/92701/Cs/22367
    GNU Screen Cheat Sheet by mynocksonmyfalcon via cheatography.com/92701/cs/22367/ Basic Screen Options Managing screen windows screen Launch a new, unnamed screen session CTRL+a c Create a new screen window screen -S name Launch a new screen session called name CTRL+a CTRL+a Return to previous active window screen -ls List all running screen sessions CTRL+a " Display screen window list screen -r name Connect to a screen session called name CTRL+a n Change to the next window in the list CTRL+a : Exit all applica​ tions and close screen session CTRL+a p Change to the previous window in the CTRL+a Detach from a screen session list CTRL+a d name Detach from the screen session name CTRL+a number Change to window by number, for 0-9 CTRL+a ? View screen help CTRL+a ' name OR Change to window by name OR by number number Other screen options CTRL+a w Display window bar if not visible CTRL+a [ Enter copy mode CTRL+a A Rename current window CTRL+a ] Paste Split Screen Management CTRL+a M Monitor a window for activity CTRL+a S Split window horizon​ tally CTRL+a _ Monitor a window for silence CTRL+a | Split window vertically CTRL+a Enter a digraph (non-ASCII character) CTRL+V CTRL+a TAB Move to the next display region CTRL+a H Enable logging for the screen session CTRL+a X Remove the current region CTRL+a Enable vertical scrolling for mouse usage (also works CTRL+a Q Remove all regions except for the current region ESC with arrow keys) By mynocksonmyfalcon Not published yet.
    [Show full text]
  • Linux Shell Scripting Cookbook Second Edition
    Linux Shell Scripting Cookbook Second Edition Over 110 practical recipes to solve real-world shell problems, guaranteed to make you wonder how you ever lived without them Shantanu Tushar Sarath Lakshman BIRMINGHAM - MUMBAI Linux Shell Scripting Cookbook Second Edition Copyright © 2013 Packt Publishing All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews. Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the authors, nor Packt Publishing, and its dealers and distributors will be held liable for any damages caused or alleged to be caused directly or indirectly by this book. Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information. First published: January 2011 Second edition: May 2013 Production Reference: 1140513 Published by Packt Publishing Ltd. Livery Place 35 Livery Street Birmingham B3 2PB, UK. ISBN 978-1-78216-274-2 www.packtpub.com Cover Image by Parag Kadam ([email protected]) Credits Authors Project Coordinator Shantanu Tushar Shiksha Chaturvedi Sarath Lakshman Proofreader Reviewers Linda Morris Rajeshwari K. John C. Kennedy Indexer Hemangini Bari Anil Kumar Sudhendu Kumar Production Coordinator Aravind SV Shantanu Zagade Acquisition Editor Cover Work Kartikey Pandey Shantanu Zagade Lead Technical Editor Ankita Shashi Technical Editors Jalasha D'costa Amit Ramadas Lubna Shaikh About the Authors Shantanu Tushar is an advanced GNU/Linux user since his college days.
    [Show full text]
  • Upgrade Operations Guide
    Oracle® Communications Network Charging and Control Upgrade Operations Guide Release 12.0.0 December 2017 Copyright Copyright © 2017, Oracle and/or its affiliates. All rights reserved. This software and related documentation are provided under a license agreement containing restrictions on use and disclosure and are protected by intellectual property laws. Except as expressly permitted in your license agreement or allowed by law, you may not use, copy, reproduce, translate, broadcast, modify, license, transmit, distribute, exhibit, perform, publish, or display any part, in any form, or by any means. Reverse engineering, disassembly, or decompilation of this software, unless required by law for interoperability, is prohibited. The information contained herein is subject to change without notice and is not warranted to be error- free. If you find any errors, please report them to us in writing. If this is software or related documentation that is delivered to the U.S. Government or anyone licensing it on behalf of the U.S. Government, then the following notice is applicable: U.S. GOVERNMENT END USERS: Oracle programs, including any operating system, integrated software, any programs installed on the hardware, and/or documentation, delivered to U.S. Government end users are "commercial computer software" pursuant to the applicable Federal Acquisition Regulation and agency-specific supplemental regulations. As such, use, duplication, disclosure, modification, and adaptation of the programs, including any operating system, integrated software, any programs installed on the hardware, and/or documentation, shall be subject to license terms and license restrictions applicable to the programs. No other rights are granted to the U.S. Government.
    [Show full text]
  • Mosh Research Paper
    Mosh: An Interactive Remote Shell for Mobile Clients Keith Winstein and Hari Balakrishnan M.I.T. Computer Science and Artificial Intelligence Laboratory, Cambridge, Mass. fkeithw,[email protected] Abstract Figure 1: Mosh in use. Mosh (mobile shell) is a remote terminal application that supports intermittent connectivity, allows roaming, and speculatively and safely echoes user keystrokes for better interactive response over high-latency paths. Mosh is built on the State Synchronization Protocol (SSP), a new UDP-based protocol that securely synchronizes client and server state, even across changes of the client’s IP address. Mosh uses SSP to synchronize a character- cell terminal emulator, maintaining terminal state at both client and server to predictively echo keystrokes. Our evaluation analyzed keystroke traces from six different users covering a period of 40 hours of real-world us- age. Mosh was able to immediately display the ef- fects of 70% of the user keystrokes. Over a commer- cial EV-DO (3G) network, median keystroke response mote servers feel more like the local computer, because latency with Mosh was less than 5 ms, compared with most keystrokes are reflected immediately on the user’s 503 ms for SSH. Mosh is free software, available from display—even in full-screen programs like a text editor http://mosh.mit.edu. It was downloaded more than or mail reader. 15,000 times in the first week of its release. These features are possible because Mosh operates at a different layer from SSH. While SSH securely con- 1 Introduction veys an octet-stream over the network and then hands it off to a separate client-side terminal emulator to be inter- Remote terminal applications are almost as old as packet- preted and rendered in cells on the screen, Mosh contains switched data networks.
    [Show full text]
  • GEODATEN NUTZEN QGIS: Laientaugliches System Mit Allen Profi-Funktionen S
    Mosh: SSH-Booster für COMMUNITY-EDITIONRecipes: Leckeres kochen den mobilen Einsatz S. 52 und mit anderen teilen S. 38 Frei kopieren und beliebig weiter verteilen ! 05.2018 05.2018 Routen planen, Tracks auswerten, geografische Daten verknüpfen, Karten bauen GEODATEN GEODATEN GEODATEN NUTZEN QGIS: Laientaugliches System mit allen Profi-Funktionen S. 16 QMapShack: Touren planen und GPS-Tracks verwalten S. 30 GMT: Maßgeschneidertes S. 24 Kartenmaterial im Eigenbau OSGeo Live: Alle wichtigen GIS-Tools einsatzfertig auf Live-DVD S. 10 Der neue Raspberry Pi 3 Modell B+ im Detail S. 80 Mehr Performance, Gigabit-LAN, 5-GHz-WLAN, Power-over-Ethernet – unser Test zeigt, was die Neuauflage bringt und welche Kompromisse die Entwickler machen Statt Dropbox und Skype LAN-Monitoring mit Linux Nextcloud 13 mit Videochats und Verdächtige Datenströme und Hosts Ende-zu-Ende-Verschlüsselung S. 64 im Netz aufspüren und beobachten S. 44 Top-Distris auf zwei • LAN-Monitoring • Logisim • Mosh • Nextcloud 13 • Pipewire • Raspberry Pi 3 B+ • Recipes • Redcore Linux • • Raspberry Pi 3 B+ Recipes Redcore • LAN-Monitoring Logisim Mosh Nextcloud 13 Pipewire Heft-DVDs LAN-MONITORING • MOSH • NEXTCLOUD 13 • PIPEWIRE • RASPI 3 B+ • • B+ 3 RASPI • PIPEWIRE • 13 NEXTCLOUD • MOSH • LAN-MONITORING EUR 8,50 EUR 9,35 sfr 17,00 EUR 10,85 EUR 11,05 EUR 11,05 2 DVD-10 05 www.linux-user.de Deutschland Österreich Schweiz Benelux Spanien Italien 4 196067 008502 05 Editorial Blendwerk Sehr geehrte Leserinnen und Leser, eigentlich muss man Facebook für die durch den Cambridge-Analytica-Skan- dal losgetretene Diskussion um den Umgang mit personenbezogenen Daten ja danken: Die Affäre macht unmissver- ständlich klar, dass die Debatten rund um Privacy bislang in völlig falschen Jörg Luther Bahnen liefen.
    [Show full text]