Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [gnu-screen]

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

0
votes
1answer
1k views

screen, expect and scripted detached interaction

Trying to write a bash script which will open a screen, start a python application, and interact with the python interaction as required when it is first started. If not possible in screen, I would ...
256
votes
13answers
82k views

Can I nohup/screen an already-started process?

I'm doing some test-runs of long-running data migration scripts, over SSH. Let's say I start running a script around 4 PM; now, 6 PM rolls around, and I'm cursing myself for not doing this all in ...
0
votes
0answers
13 views

resume tar command when nohup/screen is not possible

I have a dataset which is quite big - a few petabytes. Untarring it into a new filesystem takes a couple days. The problem is that the server does not allow me to have a process running over 24h - it ...
68
votes
6answers
76k views

Can I send some text to the STDIN of an active process running in a screen session?

I have a long-running server process inside a screen session on my Linux server. It's a bit unstable (and sadly not my software so I can't fix that!), so I want to script a nightly restart of the ...
5
votes
2answers
2k views

Cygwin Screen and SSH: Utmp slot not found -> not removed

When I use screen on my computer and detach, I am taken back to the command prompt and everything is fine. However, if I SSH into my computer remotely and use screen, when I try to detach I get the ...
0
votes
1answer
1k views

Execute a service as a specific user under ubuntu

I'm running a gameserver and want to start it on a screen on system start, but screen is user specific, so I have to run the command as 'user'. So I wrote this short service script which starts itself ...
33
votes
8answers
32k views

Using ctrl-arrow keys with PuTTY and screen

I searched and couldn't find a solution for this anywhere. I'm using PuTTY from Windows to connect to various servers where I run bash and screen. It seems bash works fine with ctrl-arrow keys to ...
0
votes
0answers
45 views

Some .screenrc commands not working in my .screenrc

When I ssh into my server a screen session is automatically started. This is my screen rc: termcapinfo xterm* ti@:te@ bind ' ' windowlist -b caption always "%{= kc}%H (system load: %l)%-21=%{= .m}%D %...
27
votes
6answers
77k views

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 ...
0
votes
0answers
16 views

Using screen/tmux to ssh into remote computers and issue a sudo elevated script for patching

Before I get a lot of suggestions, I know of patching tools like Satellite and/or config management tools and others. But I'm hoping this community will entertain me here and assist with pointing me ...
69
votes
7answers
24k views

How to check if I'm in screen session?

is it somehow possible to check if I'm right now in screen session? I need it to determine if hitting ctrl+d would disconnect me from server or just close current screen. Thanks.
149
votes
11answers
214k views

How to reconnect to a disconnected ssh session

Is there a way to connect to an ssh session that was disconnected? We are having problems with our network connection to a remote site that we are working on separately; however, in the mean time we ...
164
votes
7answers
80k views

Sudo as different user and running screen

Found out today that running screen as a different user that I sudo into won't work! i.e. ssh bob@server # ssh into server as bob sudo su "monitor" - screen # fails: Cannot ...
1
vote
0answers
70 views

Create a screen. Run said screen as a user. Detach

I'm essentially trying to combo Create screen and run command without attaching and another answer that allowed me to run a script as another user. I want to SSH from Server 1 -> Server 2 and run a ...
9
votes
12answers
100k views

Remote Desktop Connection Screen is totally black but server is working perfectly

Server is working perfectly but when I do RDC screen is only black. This happened before and I fixed it by powering off the server via KVM/IP, but I don't want do that again. How can I fix this issue. ...
0
votes
1answer
159 views

Starting java program and screen with cron at boot [duplicate]

I am trying to run a java program inside a screen session at boot, I am using the following cron, but after reboot screen -ls shows no active screen sessions. @reboot /usr/bin/screen -dmS myservice "...
58
votes
7answers
14k views

How do I know I'm running inside a linux “screen” or not?

The "screen" refers to a program mentioned in How to reconnect to a disconnected ssh session . That is a good facility. But there is a question I'd really like to know. How do I know whether I'm ...
0
votes
1answer
20 views

Can GNU screen leave you at shell prompt after command instead of exiting the TTY?

I commonly need to run a specific screen session with 9-10 windows, most of which need to run either an interactive command, or simply a setup-type of command. I do this via screen -c <config-that-...
0
votes
2answers
81 views

If run as a cronjob my shell script doesn't launch a screen

Please have a look at the following simple shell script startCleanup.sh: #!/bin/sh screen -d -m -S cleaner /usr/bin/python3 /opt/cleanup.py My crontab looks like this: * * * * * /opt/startCleanup....
36
votes
8answers
31k views

How do I ask screen to behave like a standard bash shell?

Just learned about the screen command on linux - it is genius. I love it. However, the actual terminal/prompt in screen looks and behaves differently than my standard bash prompt. That is, the ...
1
vote
0answers
62 views

How to use screen with mysql cli?

Here is what is happening. I'm using debian with KDE. I open Konsole. I use ssh to log into my amazon server. All of the following commands are done in the Konsole whiled logged into the amazon server....
11
votes
8answers
16k views

Can't get detached screen to resume

I use putty and have an unreliable wireless connection, so I use screen to keep my work going. Often I'll get disconnected, and then I can't reattach my screen. I'll run screen -D -RR and it will just ...
1
vote
1answer
103 views

On Google Cloud, GNU screen just exits with no message - Ubuntu and Debian

On Google Cloud Compute Engine GNU screen is exiting with no message. It works if I "sudo screen" but that is not what I need. The binary is suid root and has correct permissions, and I have also ...
19
votes
6answers
44k views

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 ...
7
votes
3answers
14k views

Specifying a log name for screen output without relying on .screenrc

In a bash script, I use "screen -L" to log executed commands in color. For example : screen -L tree Then we read logfile with less -R. When this script is executed, other screens are potentially ...
1
vote
1answer
124 views

Bash script: get real remote (mosh+ssh) IP

I'm using Mosh + GNU Screen for most of my remote work. I'm also moving to location during the week (with different IP addresses) and this setup keeps everything running like a charm. There is one ...
3
votes
4answers
1k views

How to use cursor keys in vi under screen?

If you run vi/vim in screen, when you press a cursor in insert mode, you get a new line + a character, which is a pain. How can I configure vim to move around instead?
1
vote
0answers
38 views

How to tell screen use use different bash_profile?

How can I tell to screen to use different bash_profile? Problem is we use a technical user to log in, but I edited a custom PS1. Normally I login with putty like: ssh user@host -t "bash --rcfile ~/....
0
votes
1answer
304 views

Unable to run X server on a remote VPS server using xvfb

My app uses the library https://github.com/wkhtmltopdf/wkhtmltopdf which requires X server. Here's a workaround: echo -e '#!/bin/bash\nxvfb-run -a --server-args="-screen 0, 1024x768x24" /usr/bin/...
8
votes
2answers
1k views

Does tmux have all the features that screen has? And those screen is missing?

I'm considering switching from screen to tmux, but I've invested lots of time developing an extensive .screenrc, and I don't want to find after many hours of porting it to tmux that tmux can't do ...
1
vote
1answer
1k views

why i cannot run screen command on openshift?

i am using redhat openshift, and find some problems now: a) why default screen can not support path which contains too much characters [xxname-xxname.rhcloud.com ~]\> which screen /usr/bin/screen ...
138
votes
9answers
122k views

Is it possible to detach a process from its terminal? (Or, “I should have used screen!”) [duplicate]

Possible Duplicate: Can I nohup/screen an already-started process? On Unix (specifically, Linux), I've started a job in a regular ssh->bash session. I'd like to leave work soon, but I now realize ...
1
vote
0answers
84 views

Create screen session in background only if it doesn't already exist

How can i create a screen in detached mode only if it doesn't exist? This creates a screen named name in detached mode but will create duplicates screen -dmS name command This creates a screen only ...
1
vote
0answers
110 views

screen Cannot access pts/0 No such file or directory

I want my script continue to run after ssh session terminate. I have no root access to server. What I tried: autos@autos.tech [~/bit]# ls -la /var/run/screen/ drwxrwxrwx 4 root screen ...
1
vote
0answers
25 views

how to avoid screen termination once the job is done [duplicate]

using a shell script i am ceating multiple screen in which i m running rsync cmnd with below syntax, n i m able to do so. screen -dmS "$SESSION_NAME" "$COMMAND" "$ARGUMENTS" but as soon as rsync ...
6
votes
2answers
3k views

What's the difference between hardstatus and caption in GNU Screen?

I've started to play with GNU Screen setting. What's the difference between hardstatus and caption in GNU Screen? hardstatus seems to appear at the bottom on the Terminal, but I don't even know what ...
3
votes
3answers
767 views

How to launch crontab commands inside of certain screen sessions?

I have a crontab that runs like this: 0 0 * * * /execute/shell/script.sh 0 0 * * * /execute/shell/script1.sh 0 0 * * * /execute/shell/script2.sh And, I want to launch each script in a different ...
23
votes
5answers
20k views

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 ...
35
votes
1answer
2k views

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 ...
2
votes
3answers
3k views

Linux - show screen logs on multiple screens?

I have a problem with screen. Basically I want it to make one log per screen, for example screen #1 will be screenlog.1 & screen #2 will be screenlog.2 - you get the memo. Anyhow, what happens is ...
0
votes
1answer
1k views

/var/run/screen permissions changing to 775 without restart

Good <Insert Part of Day>, I am currently having an issue with several of my boxes running CentOS 7.3.1611 wherein the permissions for /var/run/screen are being changed to 775, resulting in the ...
1
vote
1answer
755 views

How to detach Screen session with a command with Python Fabric

I know about Ctrl A and D combination. What actually I am looking that I am running a long process with screen. I want to programatically come out of it as I am using Fabric to automate my activities. ...
0
votes
3answers
236 views

why must I use sometimes screen -rx and not screen -r?

Sometimes to get access to screen console I need to user screen -rx and not just screen -r. Any idea why and why this happens ?
6
votes
1answer
829 views

Obtain hardcopy from a screen session

I have a job launched in a screen session which is expected to run for several hours. From time to time I'm requested to check if job is still running and guess at wich % of work is. Guess if it is ...
0
votes
1answer
219 views

Killing screen session and starting a new one, cron

I have a screen session I run with a couple windows going on it that are running a couple applications that run a console in the terminal window (thus why I run them in screen). I would like to be ...
1
vote
2answers
1k views

keeping a detached ssh process running *after closing the ssh client*

I ssh in to my ubuntu machine usimg mobaxterm. This works very well. Sometimes I want to keep a process running but exit my ssh session (and exit mobaxterm). I have tried the following but ...
0
votes
1answer
2k views

Howto get exit code of a script started in screen session

I am currently creating a backup script which uses screen to start a backup job with rsync inside a screen session. The backup jobs are started as follows. screen -dmS backup /usr/bin/rsync ... As ...
96
votes
2answers
44k views

How to re-order windows, change the scroll shortcut, and modify the status bar contents in GNU Screen?

I learned to use gnu-screen and have been using it for the past several weeks. I got a grip of the basics now, and would be very helpful if I get these queries clarified: How do I rename / reorder / ...
3
votes
2answers
2k views

in linux screen how do you turn off the status tab?

Is there a way in screen to turn off the status bar? Ideally, only display it when I have 2+ tabs open? What .screenrc entries would accomplish this?
2
votes
1answer
307 views

open screen in background and start a process

I want to do the following: After reboot I want to start a screen which then should execute a script. Therefore I searched for crontab and screen and I also did find some answers. However, nothing ...