Follow

Wow, it turns out that the parameter you pass to "screen -r" to reconnect to a session can match its name partially.
For example, if you have a session named "cmus", to reconnect to it, instead of "screen -r cmus", you can use "screen -r c" โ€” which is shorter.
I've been using screen for literal decades and didn't know that โ€” today I removed too many trailing characters from the parameters and noticed that it still worked ๐Ÿ˜†

ยท Web ยท 1 ยท 0 ยท 4
@m0xee GNU screen will also list available sessions when it's ambiguous as to which session, for example;
screen -r c
There are several suitable screens on:
13074.cgus (Detached)
19320.cmus (Detached)
Type "screen [-d] -r [pid.]tty.host" to resume one of them.

You can press the up arrow key and re-edit, but if the arrow keys are a bit far, you can just type `!-1m` and that'll connect you to cmus


These kind of things can only really be worked out by reading the GNU info pages.
@Suiseiseki @m0xee >!-1m
Holy shit that's neat
Also I'm pleased with myself for being able to understand it immediately.
@Zergling_man @m0xee There's also another fun GNU bash trick when you type sdo for a long command - you could press C-a (or home) C-d C-d C-d (or delete) and retype sudo, or you can type; `sudo !*`
Sign in to participate in the conversation
Librem Social

Librem Social is an opt-in public network. Messages are shared under Creative Commons BY-SA 4.0 license terms. Policy.

Stay safe. Please abide by our code of conduct.

(Source code)

image/svg+xml Librem Chat image/svg+xml