screen Cheat Sheet
launch screen with your individual unix id:  $ screen

Detach from Screen:

control+d, release, then type d

Find the list of screen sessions:

screen -ls
There is a screen on:
        21586.pts-3.rac02 (Detached)
1 Socket in /var/run/screen/S-ckim

If you are already attached then your screen “-ls” will show as (Attached); however, it you are already sudo’d to oracle, you will not seen a valid result set because oracle did not start the screen session.

 > screen -ls
There is a screen on:
        21586.pts-3.rac02 (Attached)
1 Socket in /var/run/screen/S-ckim.

Re-attach to previous screen session

rac02:/home/ckim
 > screen -r 21586.pts-3.rac02

If you running putty, your putty terminal title will change.

Tip:
Do not exit your screen session, always detach from it !!

Rename your screen session:

Control+a (lower a) followed by Shift+A (capital A)

Then rename “bash” to whatever you want
Again your putty terminal title will change

There is no need to start multiple sessions of screen.  Within screen, you can create sub-screen sessions:

control-a followed by c (for create)

The trick is to put a Title for each screen session:

control-a followed by Capital A

To toggle between each screen session:

control-a n --> next screen
control-a p --> previous screen

The title of your screen and window will change

List all your windows:
control-a ” 

How do you scrollback on the screen to see past output
First, create a file called .screenrc in your $HOME directory:  
Add the line below to set buffer to 32000 lines:

defscrollback 32000

To view previous buffer, go into Copy Mode

Next:
Control-a [
Control-u -  Scrolls a half page up.
Control-d -  Scrolls a half page down
Control-b -  Scrolls a full page up.
Control-f -  Scrolls the full page down.

Posted by Charles Kim, Oracle ACE Director

Posted in Linux
Share this post, let the world know

Leave a Reply

Your email address will not be published. Required fields are marked *

*