Questions tagged [gnu-screen]

GNU Screen is a software application that can be used to multiplex several virtual consoles.

GNU Screen is a full-screen window manager that multiplexes a physical terminal between several processes, typically interactive shells.

310 questions
40
votes
2 answers

Why does redirecting 'script' to /dev/null/ allow 'screen' to work while su'ed as another user?

I was su'ed into a user to run a particular long running script. I wanted to use screen but I got the error message "Cannot open your terminal '/dev/pts/4' - please check." So I Googled around and came across a forum post that instructed to run $…
Ichorus
  • 485
  • 1
  • 6
  • 12
38
votes
6 answers

Create screen and run command without attaching

I am working on automating a maintenance routine that involves starting and stopping a script that is running in a screen session. My approach is to kill the screen session, and then restart it and run the command from within a script using the…
coffeecoder
  • 483
  • 1
  • 4
  • 8
36
votes
1 answer

Recover a running script from a terminal session

So I'm using GNU Screen to manage multiple running scripts/programs. The multiplexing & detachability is quite helpful. I removed a script from disk and now I'm having some trouble finding the backup. However, one of the terminal sessions was…
Fdo
  • 463
  • 4
  • 6
36
votes
6 answers

Is there a way to make a "Screen" session survive reboot?

I am using the Screen utility and would like to preserve the session when the machine reboots. If not possible may be you can recommend other alternatives to Screen that would allow to preserve the sessions between reboots. I am using Ubuntu Server…
Sergey G
  • 475
  • 1
  • 4
  • 6
33
votes
3 answers

Reattach or create a named screen session? (or persistent screen sessions)

Basically I have a remote screen session, which I wish to automatically reattach to.. Currently I'm doing this by with the following command (as an iTerm bookmark, or an alias) ssh host -t screen -x thesessionname This works fine, but if the…
dbr
  • 1,568
  • 3
  • 16
  • 18
31
votes
11 answers

Hidden Features of `screen`

Since I use the *nix command screen all day, and I couldn't find anyone starting this question, I figured it should be started. You know the drill: community wiki, one answer per features so we all can vote.
Josh
  • 9,190
  • 28
  • 80
  • 128
25
votes
3 answers

Start Unix screen, Run command, Detach

How can screen be used to start a new session and run a command within that session without killing that session? screen -S myScreenName runSomething I tried the above command and it says [screen is terminating] Did it run the command then kill…
Nyxynyx
  • 1,459
  • 11
  • 39
  • 49
23
votes
6 answers

How to run script via SSH that doesn't end when I close connection?

I need to run script, that takes long time to execute, or I just want it to run forever. I can't just SSH to my machine, because when I disconnect it stops running. Is there any way to run script that isn't dependent on the shell that started…
Jakub Arnold
  • 1,744
  • 10
  • 26
  • 33
22
votes
6 answers

kill a screen (but not all screens)

I have multiple screens running on an Ubuntu server that are initiated as: screen -dmS screen1 cmd screen -dmS screen2 cmd etc... And I need to kill one screen, but not all of them. What is the correct command to kill a single particular screen…
BassKozz
  • 645
  • 2
  • 8
  • 15
21
votes
2 answers

How to tell GNU screen to run .bash_profile in each new window?

When I open a new window in GNU screen, it runs .bashrc but not .bash_profile. In my setup, this results in some environment variables not being set up correctly in that window. How can I tell GNU screen to always run .bash_profile instead of…
user9474
  • 2,448
  • 2
  • 25
  • 26
19
votes
5 answers

How do I use crontab to start a screen session?

I want to create a crontab entry so that it starts screen, starts a gameserver and detaches. This is for in case the server is rebooted and I want it to automatically start this for me. 0 0 0 0 0 (command) should run upon startup. It runs a shell…
Victor
  • 371
  • 1
  • 3
  • 9
16
votes
3 answers

Cannot reattach to a screen session after SSH connection was dropped

I have previously reattached to a long-running screen session with screen -dr control. However, sometimes this command will not reattach to the screen and instead hang forever (10+ minutes after which I aborted). This only happens when the SSH…
15
votes
3 answers

Setting $TERM for gnu screen

So I have screen compiled with 256 colors, running on Konsole in 256 color mode. If start screen, the TERM is set to "screen". If I manually export the TERM to screen-256color everything works beautifully. I have two questions. The first is why…
Zxaos
  • 496
  • 3
  • 6
  • 18
13
votes
4 answers

How do I prevent GNU Screen from reseting my prompt?

When I run screen it changes my prompt. How do I prevent this behaviour? For example: $ echo $PS1 \[\e]0;\h:Prod\a\]\n\[\e[32m\]\u@\h \[\e[33m\]\w\[\e[0m\]\n\$ $ screen $ echo $PS1 [\u@\h \W]\$ Interestingly, it does not do this on other…
Swoogan
  • 2,087
  • 1
  • 14
  • 21
13
votes
6 answers

How to scroll back in screen within a ssh session from OS X?

I do the following: Open Terminal.app Open a ssh session to a remote Linux server Open a screen session on the server Start a program who breaks with many lines of error reporting… How can I scroll up to read that? And no, fixing the program is…
Max
  • 465
  • 2
  • 6
  • 11
1
2
3
20 21