terminate screen monitoring serial port

Use the screen quit command (normally ctrl-A \).


I run all my terminals inside a screen, and also sometimes use screen to connect to serial. If you screen /dev/ttyUSB0 inside screen, you'll just get a new window in your current session, not a new child screen.

In this case, press Ctrl-A k to kill only the current window rather than the entire screen process and your other windows with it. This is the kill window command.


Though aecolley's answer usually works then it did not work for me (could be because of Icelandic keyboard and Icelandic locale, but somehow doubt it). When in that situation then you can go to a different console and execute screen -ls and take note of the screen session number, the output should be something like this:

There is a screen on:
            6254.tty2.hostname           (Attached)
1 Socket in /var/run/screen/S-root

The screen session number her is then 6254.

Then you can issue the following command to close that screen session: screen -X -S 6254 quit