You are not logged in.

#1 2009-04-26 21:42:00

Xi0N
Member
From: Bilbao - Spain
Registered: 2007-11-29
Posts: 832
Website

Questions abourt Screen

I discovered the screen command some days ago, and i am starting to use it, but, even checking the man pages, i still have some questions about its usage:

I ssh into a headless server of mine, and then i run the command screen.
Then, in that "screen" i created and i am in, i run, for example, finch (Console-mode pidgin) - that is full screen. How can i open now, without closing this program, access to the prompt or change to another screen instance? i am doing it currently by closing the connection (closing the terminal which i used to ssh) and ssh back to my server again.... but i dont think this is the correct way.... anyone with extensive screen knowledgement? smile

Thanks!

Offline

#2 2009-04-26 21:58:21

lucke
Member
From: Poland
Registered: 2004-11-30
Posts: 4,018

Re: Questions abourt Screen

Ctrl-A-D to detach and then "screen -r" to reattach.

Last edited by lucke (2009-04-26 21:59:41)

Offline

#3 2009-04-26 22:01:28

Xi0N
Member
From: Bilbao - Spain
Registered: 2007-11-29
Posts: 832
Website

Re: Questions abourt Screen

lucke wrote:

Ctrl-A-D to detach and then "screen -r" to reattach.

Exactly what i was looking for . Thanks!! cool

Offline

#4 2009-04-26 22:02:12

nebri
Member
Registered: 2009-01-03
Posts: 30

Re: Questions abourt Screen

Hey Xion,

screen is a handy lil program, I use it all the time as well. Once you have screen running, and you want to get off that instance of screen you first need to detach it. [ctrl]+A+D will detach the screen putting you back to your regular bash shell.

Now you can create another screen session the exact same way as your first. You can use screen -ls to get a listing of your currently running screen sessions in the background. Then to reattach you simply type screen -r [# of session]

Also if you start screen with the -S option, you can name that session so you can pick it out easier with -ls. for example

screen -S [session name]

hope this helps smile

Offline

#5 2009-04-26 22:03:42

Xi0N
Member
From: Bilbao - Spain
Registered: 2007-11-29
Posts: 832
Website

Re: Questions abourt Screen

Thanks to both: Is a new tool that i discovered, and that will come handy for my headless server.

Many, many thanks to both smile

Offline

#6 2009-04-26 23:04:30

leo2501
Member
From: Buenos Aires, Argentina
Registered: 2007-07-07
Posts: 658

Re: Questions abourt Screen

this is so useful, put this in .bashrc

function scr {
if screen -ls | grep -q Main; then
        screen -xr Main
else
        screen -S Main
fi
}

then type scr in the terminal, and it mount your existing screen session, this is useful for one screen session and not when you use two or more screens


Perfection is achieved, not when there is nothing more to add, but when there is nothing left to take away.
-- Antoine de Saint-Exupery

Offline

#7 2009-04-26 23:13:23

Xi0N
Member
From: Bilbao - Spain
Registered: 2007-11-29
Posts: 832
Website

Re: Questions abourt Screen

Thanks for the tip smile

Offline

#8 2009-04-26 23:38:36

dmartins
Member
Registered: 2006-09-23
Posts: 360

Re: Questions abourt Screen

I usually don't have more than one instance of screen running because you can have multiple windows inside of a single screen session.
Ctrl+a c creates a new window.
Ctrl+a n or p switches to next/previous window
Ctrl+a w lists current windows
Ctrl+a 0-9 switches to that window number

Offline

Board footer

Powered by FluxBB