linux screen cheat sheet

Let's say that you are running a command on a linux shell and it's taking a long time. Further, you need to disconnect your session to get on the bus or your session gets disconnected because your net connection is flakey.

Screen to the rescue

Imagine if you could just disconnect from your shell session and then reconnect. Well, you can :)

Screen Cheat Sheet

Command What it does
ctrl+a+c make a new screen
ctrl+a+n "next screen down the line"
ctrl+a+p "previous screen down the line"
ctrl+a+k kills current screen until last one then you're out
ctrl+a+d leave, but leave them running and re-attachable
screen -ls 31619.something.else (Detached)
screen -r 31619.something.else re-attaches to that session

So - that quick guide should provide the commands you need in the order you need them. And then you'll be more productive and then you'll be happier because you'll be doing it efficiently :)



What I use all the time:
screen -DDR
to re-attach any (the first) detached session.
If there is none, it creates a new session.

Screen Cheat Sheet

Hey! I also made a screen cheat sheet and published it in PDF and TXT.

The article and download links are on my catonmat blog - Screen Term Emulator Cheat Sheet

Peteris Krumins

that what I expect 2 find

@screen -DDR

very clever.. I will try this with an alias or maybe there is a .screenrc way

Post new comment

The content of this field is kept private and will not be shown publicly.