Questions tagged [gnu-screen]

screen (GNU Screen) is a full-screen window manager that multiplexes a physical terminal between several processes, typically interactive shells. Before using this tag, read the "Which site is more appropriate?" section of the tag wiki.

screen (GNU Screen) is used to create virtual terminals, which run by their own when not under direct user control. This is especially useful while working with a remote system, when a disconnect can occur at any moment. In this case, the screen session will continue to execute and you may reattach a running screen later.

Screen also allows you to execute multiple commands in a single terminal without losing control over them.

One additional trick is that a single virtual screen can be used by several users simultaneously, allowing them to guide and observe actions of each other.

Which site is more appropriate?

If you intend to tag your question with this tag, consider if the question is more suitable for other Stack Exchange sites:

1022 questions
0
votes
2 answers

Script runs fully when ran manually but misses commands when ran from another script

I have 2 scripts that I'm testing to automate starting services on my server however they behave weirdly. The first script is #!/bin/sh screen -dmS Test_Screen sleep 1 sudo sh cd.sh echo "finished" Which runs perfectly however the script it runs…
JLennon
  • 1
  • 1
0
votes
1 answer

How to kill all jobs running in background (unix) which ran with script in screen?

I ran 1000 background jobs with bash script in screen mode. How can I kill all those jobs at a same time. How I ran all jobs: screen #enter bash script.sh ## script.sh: #!/bin/bash for i in {1..1000} do program -k $i -o out$i & done
SSh
  • 179
  • 2
  • 13
0
votes
1 answer

switch to autologin TTY

I have set up auto login on a machine and modified .bashrc so that a script runs automatically (e.g. mplayer playing a music stream). Now I log in using ssh and screen. Command w shows the ttys used by the autologin and the current one from the ssh…
xaratustra
  • 647
  • 1
  • 14
  • 28
0
votes
1 answer

Window title in screen session not saved

I use screen in centos, but the title of window not saved after call to any command. Stack: # Create a screen $ screen # Create a new window in screen # Ctrl + a: c # Set title of window # Ctrl + a: A # Write a "Some" window title (See screenshot…
ZhukV
  • 2,892
  • 6
  • 25
  • 36
0
votes
1 answer

PHP Exec bash script to restart screen session

So, I wanted to create a sort of a webadmin panel to restart an IRC bot running in Python. I have a Bash script that succesfully restarts the bot through the terminal but, when using it with exec on a PHP page it only stops it but doesn't start it…
FábioMartinho
  • 49
  • 2
  • 2
  • 12
0
votes
1 answer

Seeing screen Error Messages Which Appear Whilst Not On screen

I am using the "screen" tool to run a Node.js API on a server. I can get the API running so it is active for all to see but it crashes occasionally and it always happens when the screen session is no long open and therefore I don't know why the API…
Haych
  • 932
  • 13
  • 36
0
votes
1 answer

Automate SSH and screen commands

I have a PHP script with a web interface which is used to provide input into a process which I am automating. In this process, I am attempting to include using SSH and screen to run some commands (all sent through PHP's exec). I am currently using…
Tim
  • 810
  • 9
  • 20
0
votes
1 answer

Find error in Python script running inside Screen

I have written a python script that runs infinite using loops. The script is started inside a screen session. However sometimes, after a few hours or even days, it breaks down for a reason i dont now, because screen session closes when that…
Mathias
  • 1
  • 2
0
votes
1 answer

Start multible Scripts in a Named Screen Session with multible Named Tabs with ONE script? [Debian]

Hi Guys i have a little problem. Nkay let me explain this Ive got 3 Directorys with 3 different launch Scripts. user/dir1/launch1.sh user/dir2/launch2.sh user/dir3/launch2.sh user/startall.sh How do i build a Script to start all 3 launch scripts…
0
votes
2 answers

Sending Bash Aliases to detached screen sessions

I'm on a Linux machine using screen, and I'm attempting to write a (fairly portable) function which runs a bash function in a new, detached screen session which automatically closes upon completion. I've had some success, but I noticed the…
chriswhite
  • 1,370
  • 10
  • 21
0
votes
1 answer

How to open multiple screen named virtual terminal sessions

I use Linux (GNU) screen daily. When my machine needs to reboot, I want to be able to rebuild the screen session via a script. I want to be able via a bash scrip to start the screen session (this I know how to do) and open multiple virtual…
ShlomoD
  • 1
  • 1
0
votes
1 answer

A bash script to concatenate strings and editing a line in the same file using a bash script

I was trying to write a bash script to run several cases where the steps are the following: reading a .txt file in an array concatenate each element of an array with a specific string opening several screens in detached mode and then changing a…
prashanta_himalay
  • 149
  • 2
  • 2
  • 9
0
votes
1 answer

Copy screenlog.n file and restart log?

I'm running a application using gnu screen and logging everything the the -L flag. The screenlog.n file is being created just fine. What I would like to copy the contents of that file to something like log_, and then clear the screenlog.n…
the3rdNotch
  • 637
  • 2
  • 8
  • 18
0
votes
0 answers

Create a screen session, then startup three windows

I'm trying to write a script that will create 4 background processes doing different things on my server, but I'm really struggling to get it working. My script looks like this: screen -d -m -S processes screen -S processes -X alarm-daemon bash -c…
Ross Dargan
  • 5,876
  • 4
  • 40
  • 53
0
votes
1 answer

How can I execute a command after screen exits

launching rsync in named screen so I can reattach to check progress, how can I run a command after the rsync, as is it launches the screen then immediately executes the command? screen -dmS name rsync ssh user@hostname 'rm -r ~/path/*' I'm…
G.Martin
  • 135
  • 7