Unix & Linux Stack Exchange
Q&A for users of Linux, FreeBSD and other Unix-like operating systems
Latest Questions
5
votes
1
answers
85
views
Regaining key for renaming in GNU screen
Running screen for several months with ~30 open windows, I am renaming windows from time to time with C-a A . But for some reason unknown to me, I can no longer do this. That is, I can say C-a " to view all current windows with their name. If I type there C-a A I get the expected : title: window req...
Running screen for several months with ~30 open windows, I am renaming windows from time to time with C-a A. But for some reason unknown to me, I can no longer do this.
That is, I can say C-a " to view all current windows with their name. If I type there C-a A I get the expected
: title: window required
So the keys as such seem to work. But when I go back with Esc and try to rename a window it does not work. Other commands like C-a ' or C-a C-a work as expected.
Since I do not want to restart
screen(1)
, is there a way to get out of that hidden state?
[This question](https://unix.stackexchange.com/questions/314890/what-is-the-text-command-for-naming-a-window-in-gnu-screen) while apparently similar, did help to work around it somewhat. The :title
command did not prompt for a new name, but :title newname
worked. However, I would like to get the original command back.
The help screen C-a ? still suggests A for a title
false
(151 rep)
Aug 2, 2025, 08:30 AM
• Last activity: Aug 2, 2025, 11:34 AM
12
votes
2
answers
11338
views
Save past GNU screen output to a file
I have had a GNU screen session running for days. I find myself in the situation that I need to save the terminal contents (which I can scroll up to see) into a file. Is this possible? I estimate it to be below 5000 lines. I found a way to set up screen to log *future* output to a file. But in this...
I have had a GNU screen session running for days. I find myself in the situation that I need to save the terminal contents (which I can scroll up to see) into a file. Is this possible? I estimate it to be below 5000 lines.
I found a way to set up screen to log *future* output to a file. But in this case, I need to also save past output (or as much of it as is present).
Szabolcs
(223 rep)
Oct 18, 2019, 06:22 PM
• Last activity: Jul 12, 2025, 07:14 AM
4
votes
1
answers
1898
views
Read GNU screen session without attaching to it
I use GNU screen mostly to run commands that become non-interactive after some initial input. I do not like navigating output in screen sessions, I feel it is a bit buggy. **Is there a way to access the history of a screen session without `screen -r `?** (Not sure about the correct terminology here,...
I use GNU screen mostly to run commands that become non-interactive after some initial input.
I do not like navigating output in screen sessions, I feel it is a bit buggy.
**Is there a way to access the history of a screen session without
screen -r
?** (Not sure about the correct terminology here, I simply mean all the input and output that has occured in the screen session, not the history in the sense of the commands that were entered in the shell prompt).
Ideally, I'd like to do this with (1) bash/Linux builtins, (2) else with screen
itself, (3) else with a Python package, (4) and only if none of these are possible with an external program.
(1: e.g. cat /run/screen/S-user/12345.pts-1.pc
2: e.g. screen --cat 12345
3: e.g. pip install screen; python -c 'import screen;print(screen.read_socket("12345"))'
4: e.g.sudo apt install screenreader; screenreader 12345
)
Bananach
(465 rep)
Aug 25, 2018, 02:15 PM
• Last activity: Jul 10, 2025, 02:10 PM
0
votes
1
answers
1984
views
Systemd with detached screen
I want to start a service with a `screen` command in detached more. The backgound is, that it shall read a serial interface and with reconnecting to the screen I want to be able to interact in case of errors or so to send commands via the serial interface. Currently I have systemd service file ``` [...
I want to start a service with a
screen
command in detached more. The backgound is, that it shall read a serial interface and with reconnecting to the screen I want to be able to interact in case of errors or so to send commands via the serial interface.
Currently I have
systemd service file
[Unit]
Description=read serial interface
[Service]
User=someUser
Group=someUser
Type=forking
Restart=on-failure
RestartSec=3
WorkingDirectory=/home/someUser/dev
ExecStart=/usr/bin/screen -DmS serial-magic /home/someUser/dev/run-serial-magic.sh
[Install]
WantedBy=multi-user.target
Script under /home/someUser/dev/run-serial-magic.sh
#!/bin/bash
pio device monitor -b 115200 -p /dev/ttyUSB0 | tee test.log
I already tried
- moving the screen
inside the script.
- using Type=simple
with screen option -d
instead of -D
The script is working if I call it manually from the command line. I can return to the screen and detach it again.
But when I start the service sudo journalctl -f -u someServoce.service
just gives me
Okt 23 18:13:28 someHost systemd: Starting read serial interface...
But screen -list
says
No Sockets found in /run/screen/S-someUser.
SolvedForHome
(1 rep)
Oct 23, 2020, 04:26 PM
• Last activity: Jul 3, 2025, 11:03 AM
26
votes
3
answers
175401
views
How to scale the resolution/display of the desktop and/or applications?
While using Xorg X11, on KDE/Gnome/XFCE **how can we scale the display/resolution** for the whole desktop and/or per application? **(when this is not available on the settings GUI)** The purpose is to keep the screen resolution unchanged (at max) while scaling the size (bigger/smaller) of the deskto...
While using Xorg X11, on KDE/Gnome/XFCE **how can we scale the display/resolution** for the whole desktop and/or per application? **(when this is not available on the settings GUI)**
The purpose is to keep the screen resolution unchanged (at max) while scaling the size (bigger/smaller) of the desktop/applications.
intika
(15066 rep)
Jul 5, 2020, 08:46 PM
• Last activity: Jun 24, 2025, 08:59 PM
3
votes
1
answers
2145
views
How do I find what process is running in a particular GNU screen window?
## Problem I need to find what process is running on a particular window in screen (in a reasonable amount of time). ## Scenario I need to use the Session Name and Window Title to find the process running therein. It needs to not be super slow. Also potentially noteworthy: I'm using byobu as a wrapp...
## Problem
I need to find what process is running on a particular window in screen (in a reasonable amount of time).
## Scenario
I need to use the Session Name and Window Title to find the process running therein. It needs to not be super slow.
Also potentially noteworthy: I'm using byobu as a wrapper for screen.
## What I've tried
* Searching the internet
* Reading the screen man page (not for the faint of heart). *(Okay, I didn't read all of it, but I did most of the relevant sections and searched it very thoroughly for anything that might be useful.)*
- What I learned:
+ The only way to gain the information I might need from screen (by calling screen) is through the use of it's command line flags.
* -Q will allow you to query certain commands, but none of these provided everything that I need. The one that I'm using returns the Window number.
- number - what I'm using to get the window number
- windowlist - allows you to get a custom-formatted string of information, but the session PID is not one of the things you can ask for
- echo, info, lastmsg, select, time, title are the other ones and none of these looked useful
* -ls lists the active sessions. It prepends the PID to the session name, so this is how I'm currently getting the session PID.
+ Once I have the PID of the shell running in a specific Window, I can check its environment variables for WINDOW. This variable is set to the window number. This is what I'm using to match the process to the window.
+ There is no single command that will allow me to return the session PID and a map of the window titles to window numbers. Also, I could find no way to deterministically find the session id and window title to window number map outside of calling screen.
* Trial and error / digging through environment variables
* Writing a script
## My Script
I wrote a script that seems to successfully solve the problem, but it takes a little over 0.75 seconds to run. This is far too long for what I need done, but more importantly, far too long when a server is waiting for its completion to send the response to an HTML request.
Here is the script:
#!/bin/bash
# Accept the name of a GNU/screen session & window and return the process running in its shell
SessionName=$1
TabName=$2
# ====== Averages 0.370 seconds ======
# This finds the window number given the session name and window title
# The screen command queries screen for the window number of the specified
# window title in the specified session.
# Example output of screen command: 1 (Main)
# Example output after cut command: 1
TargetTabNum=$(screen -S $SessionName -p $TabName -Q number | cut -d ' ' -f1)
# ====== Averages 0.370 seconds ======
# This finds the session PID given the session name.
# The screen command prints the list of session IDs
# Example output of screen command:
# There is a screen on:
# 29676.byobu (12/09/2019 10:23:19 AM) (Attached)
# 1 Socket in /run/screen/S-{username here}.
# Example output after sed command: 29676
SessionPID=$(screen -ls | sed -n "s/\s*\([0-9]*\)\.$SessionName\t.*/\1/p")
# ====== The rest averages 0.025 seconds ======
# This gets all the processes that have the session as a parent,
# loops through them checking the WINDOW environment variable for
# each until it finds the one that matches the window title, and
# then finds the process with that process as a parent and prints its
# command and arguments (or null if there are no matching processes)
ProcessArray=( $(ps -o pid --ppid $SessionPID --no-headers) )
for i in "${ProcessArray[@]}"
do
ProcTabNum=$(tr '\0' '\n' &2
exit 1
As you can see, the problem commands are the two screen commands. I can get rid of one of them by searching for a screen process launched with the session name, but this feels kind of flaky and I'm not sure it would be deterministic:
SessionPID=$(ps -eo pid,command --no-headers | grep -i "[0-9]* screen.*\-s $SessionName " | grep -v grep | cut -d ' ' -f1)
## Goal
I would like to have a fast, reliable way to determine the process currently running in a specific screen window. I feel like I'm just missing something, so I would be very grateful if one of you spot it!
(I'm still fairly knew to StackExchange, so any feedback on my question is welcome!)
UrsineRaven
(118 rep)
Dec 10, 2019, 07:19 PM
• Last activity: Jun 21, 2025, 07:08 PM
0
votes
2
answers
2146
views
Keep python script running after ssh closed
I am trying to run a script called `script.py` on a remote CentOS 7.3 box that I ssh into. I am running the script from an environment called `py`. I want the script to continue running after I disconnect. From reading other stack exchange questions I have tried conda activate py nohup python script...
I am trying to run a script called
script.py
on a remote CentOS 7.3 box that I ssh into. I am running the script from an environment called py
. I want the script to continue running after I disconnect. From reading other stack exchange questions I have tried
conda activate py
nohup python script.py &
This works, but when I disconnect the ssh the process stops running.
I have also tried
screen
conda activate py
python script.py
However, this gives me a NameError
pertaining to a function in a module that is in my py
environment but not in base
. So it looks like when I use screen
its not using the py
environment.
Finally I do not have tmux
installed and cannot do so as it is a work box.
Any other ideas?
mch56
(101 rep)
Feb 11, 2021, 11:38 AM
• Last activity: Jun 6, 2025, 03:06 AM
0
votes
1
answers
59
views
How do I show the screen session name in GNU screen status Line?
I've created a `~/.screenrc` file based on [another question](https://unix.stackexchange.com/questions/114505/gnu-screen-status-bar-how-to-make-it-display-shell-session-names) here: ``` autodetach on startup_message off hardstatus alwayslastline shelltitle 'bash' hardstatus string '%{gk}[%{wk}%?%-Lw...
I've created a
~/.screenrc
file based on [another question](https://unix.stackexchange.com/questions/114505/gnu-screen-status-bar-how-to-make-it-display-shell-session-names) here:
autodetach on
startup_message off
hardstatus alwayslastline
shelltitle 'bash'
hardstatus string '%{gk}[%{wk}%?%-Lw%?%{=b kR}(%{W}%n*%f %t%?(%u)%?%{=b kR})%{= w}%?%+Lw%?%? %{g}][%{d}%l%{g}][ %{= w}%Y/%m/%d %0C:%s%a%{g} ]%{W}'
Which is great, except that it doesn't contain anything that's useful to me! What I would like the hardstatus string
to display is the "name" I give when I started screen
.
For example, if I start a screen
session as follows:
$ screen -S bluetoothctl bluetoothctl
I would like the string "bluetoothctl" displayed in the status line/hardstatus string
.
How do I do that?
Seamus
(3772 rep)
May 14, 2025, 09:58 PM
• Last activity: May 16, 2025, 02:46 AM
2
votes
2
answers
2336
views
My bash prompt is not working in `screen`
On RedHat, `screen` resets my bash prompt. I set `PS1=\u@\h:\w` in `~/.bashrc` and `~/.bash_profile`. I added `shell -$SHELL` as well to ` ~/.screenrc`. But, when I open a brand new terminal window, the prompt is correct, except in `screen`. In `screen` I always get this prompt format: `\u@\h>` How...
On RedHat,
screen
resets my bash prompt. I set PS1=\u@\h:\w
in ~/.bashrc
and ~/.bash_profile
.
I added shell -$SHELL
as well to ~/.screenrc
.
But, when I open a brand new terminal window, the prompt is correct, except in screen
.
In screen
I always get this prompt format: \u@\h>
How can I set the same prompt in screen
?
user2013619
(375 rep)
Sep 12, 2013, 08:21 AM
• Last activity: May 15, 2025, 07:01 PM
27
votes
6
answers
61564
views
Send file by xmodem or kermit protocol with GNU screen
I work with an RS-232 device via GNU `screen`. $ screen /dev/ttyUSB0 115200 At some point I need to send a local file to the device using either the `xmodem` or `kermit` protocol. On Windows I use TeraTerm which has a corresponding menu item. How can I achieve this in GNU screen?
I work with an RS-232 device via GNU
screen
.
$ screen /dev/ttyUSB0 115200
At some point I need to send a local file to the device using either the xmodem
or kermit
protocol. On Windows I use TeraTerm which has a corresponding menu item. How can I achieve this in GNU screen?
user14284
Nov 25, 2012, 09:45 AM
• Last activity: May 9, 2025, 07:18 AM
0
votes
1
answers
2357
views
attach to tty running a process
I have a systemd service file that runs a java program in another tty [Unit] Description=java program After=network-online.target [Service] Type=simple ExecStart=/usr/bin/java -cp "/home/user/someclass.jar" Restart=always RestartSec=10 StandardInput=tty-force StandardOutput=inherit StandardError=inh...
I have a systemd service file that runs a java program in another tty
[Unit]
Description=java program
After=network-online.target
[Service]
Type=simple
ExecStart=/usr/bin/java -cp "/home/user/someclass.jar"
Restart=always
RestartSec=10
StandardInput=tty-force
StandardOutput=inherit
StandardError=inherit
TTYPath=/dev/tty10
TTYVTDisallocate=yes
TTYReset=yes
TTYVHangup=yes
[Install]
WantedBy=multi-user.target
The program waits for input in the tty, I can change to that tty by using Ctrl+Alt+F10 or using
chvt 10
and I'm able to interact with the program.
Now I want to send input and get output from that tty without changing my current tty.
I tried using screen
and all I get is a blank screen and. I tried using script
which succeeded if I run bash in that tty but fails If i run a java program
MOHAMMAD RASIM
(530 rep)
Mar 6, 2018, 11:18 AM
• Last activity: Apr 25, 2025, 02:03 PM
1
votes
1
answers
56
views
How to send a "keypress" to an instance of 'mpg123' started under 'cron'?
I use `mpg123` to play a list of songs while I work. The host that actually runs `mpg123` and plays the music is a *local, headless system*, but I can connect to it over SSH. I start `mpg123` on this host in `cron`; it plays the audio tracks from my "playlist" in a continuous loop. However there are...
I use
mpg123
to play a list of songs while I work. The host that actually runs mpg123
and plays the music is a *local, headless system*, but I can connect to it over SSH. I start mpg123
on this host in cron
; it plays the audio tracks from my "playlist" in a continuous loop. However there are times when I need to pause the music (incoming phone calls, visitors, etc).
man mpg123
says that by pressing the s
key once I can pause the playing, and press it again to re-start. If I start mpg123
in a terminal, and leave it running, this works fine. I've [also learned](https://superuser.com/q/1000905/907399) that it's possible to send a "pause" signal (s
) to mpg123
when it is being played in a screen
session:
$ screen -S mpg123 # to start the screen session
$ /usr/bin/mpg123 --loop -1 /home/pi/rainstorm.mp3 # for example
'ctrl+a, d' # quit screen
...
$ screen -S mpg123 -X stuff "s" # pauses play
I found a question ***similar*** to mine [here on SO](https://stackoverflow.com/questions/18808007/sending-keystroke-to-a-process) , but the answer seems to *miss the mark* - at least I didn't understand it!
I've not been able to find a method that allows me to send a "pause" (s
) command to mpg123
if it was started under cron
. I'd prefer a *more direct* route than screen
to send this command to mpg123
, plus I'm not sure if this could even be set up using cron
.
Can someone please advise on an approach? I'd prefer a "bash
solution" to one that requires (for example) a C program - but happy to take whatever I can get!
Seamus
(3772 rep)
Mar 29, 2025, 06:21 AM
• Last activity: Mar 30, 2025, 07:12 AM
5
votes
2
answers
378
views
Automatic or manual screen session termination
I've created a `screen` session and ran `rsync` within that session: screen -S rsync_backup rsync -rvnc data/ data2 >rsync_out-4.txt 2>rsync_outErr-4.txt I used the `top` command for progress monitoring and initially I saw both the `screen` and `rsync` in the `top` output (toy example is below): PID...
I've created a
screen
session and ran rsync
within that session:
screen -S rsync_backup
rsync -rvnc data/ data2 >rsync_out-4.txt 2>rsync_outErr-4.txt
I used the top
command for progress monitoring and initially I saw both the screen
and rsync
in the top
output (toy example is below):
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
1619 denis 20 0 170096 4644 0 S 0.0 0.0 0:00.00 rsync
1739 denis 20 0 7320 2828 2064 S 0.0 0.0 0:00.02 screen
Some time later there was no rsync
, but screen
still be present in the top
output:
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
1739 denis 20 0 7320 2828 2064 S 0.0 0.0 0:00.02 screen
My questions are:
1. Should screen
session automatically terminated when command (rsync
in my case) running within that session will be finished?
2. Does typical user
scenario assume mandatory manual screen
session killing after command (e.g. rsync
) execution finishing? I.e.:
screen -S rsync_backup
rsync -rvnc data/ data2 >rsync_out-4.txt 2>rsync_outErr-4.txt
screen -XS quit
Denis
(153 rep)
Mar 18, 2025, 01:37 PM
• Last activity: Mar 19, 2025, 11:54 AM
0
votes
0
answers
17
views
Nvim syntax highlighting disabled by screen command
When I open up neovim on my raspbian device the syntax highlighting works perfectly well. As soon as I use the screen command (to create a multi-paned setup) nvim becomes black and white. Colors remain in bash after the screen command, and this problem persists across reboots. Any idea what's going...
When I open up neovim on my raspbian device the syntax highlighting works perfectly well. As soon as I use the screen command (to create a multi-paned setup) nvim becomes black and white. Colors remain in bash after the screen command, and this problem persists across reboots. Any idea what's going on and how I can fix it?
Sambews
(1 rep)
Mar 18, 2025, 10:37 AM
• Last activity: Mar 18, 2025, 11:48 AM
1
votes
3
answers
3569
views
Losing color when starting screen session
I have a RHEL 6.9 host that loses its color when starting a screen session. Vim colors and directory colors exist before starting the screen session. Here are a few settings to help troubleshoot: - $TERM returns screen - I am using `force_color_prompt=yes` in my bashrc - `echo "$(tput setaf 1)red$(t...
I have a RHEL 6.9 host that loses its color when starting a screen session. Vim colors and directory colors exist before starting the screen session. Here are a few settings to help troubleshoot:
- $TERM returns screen
- I am using
force_color_prompt=yes
in my bashrc
- echo "$(tput setaf 1)red$(tput sgr0)"
successfully prints out red (in red)
Any advice on how to fix is appreciated, thanks!
ProdIssue
(965 rep)
May 14, 2018, 03:04 PM
• Last activity: Mar 18, 2025, 11:39 AM
0
votes
1
answers
82
views
screen is killed when ssh disconnects
I found several similar questions but AFICT they don't apply to my situation. Some [e.g. this one for tmux](https://unix.stackexchange.com/questions/171503/tmux-session-killed-when-disconnecting-from-ssh) and elsewhere on Ubuntu suggest it is due to using `ssh.socket`, but my install is not even usi...
I found several similar questions but AFICT they don't apply to my situation.
Some [e.g. this one for tmux](https://unix.stackexchange.com/questions/171503/tmux-session-killed-when-disconnecting-from-ssh) and elsewhere on Ubuntu suggest it is due to using
ssh.socket
, but my install is not even using that, it is still on ssh.service
.
I found some suggestions for disabling the auto logout on timeout, but I don't want to disable it, I want screen
to be running when I log back in. If I exit from ssh
(with ~.).
I saw somewhere it is related to when the service starts. Could it be preset: disabled
setting of OpenSSH Daemon
?
$> systemctl status ssh*
● sshd.service - OpenSSH Daemon
Loaded: loaded (/usr/lib/systemd/system/sshd.service; enabled; preset: disabled)
Active: active (running) since Thu 2024-10-17 22:58:56 UTC; 4 months 3 days ago
Process: 2107 ExecStartPre=/usr/sbin/sshd-gen-keys-start (code=exited, status=0/SUCCESS)
Process: 2110 ExecStartPre=/usr/sbin/sshd -t $SSHD_OPTS (code=exited, status=0/SUCCESS)
Main PID: 2112 (sshd)
Tasks: 1
CPU: 14.713s
CGroup: /system.slice/sshd.service
└─2112 "sshd: /usr/sbin/sshd -D [listener] 0 of 10-100 startups"
Miserable Variable
(325 rep)
Feb 20, 2025, 02:29 PM
• Last activity: Feb 20, 2025, 04:57 PM
-1
votes
2
answers
428
views
how to exit from "screen /dev/ttyUSB0 115200"
Using a usb-to-serial cable I can connect to a piece of equipment successfully via `screen /dev/ttyUSB0 115200` Is there a command once within screen that will close that and return my terminal prompt? This is in RHEL-8.10. `ctrl-d` and `ctrl-c` and `ctrl-z` has no affect.
Using a usb-to-serial cable I can connect to a piece of equipment successfully via
screen /dev/ttyUSB0 115200
Is there a command once within screen that will close that and return my terminal prompt? This is in RHEL-8.10. ctrl-d
and ctrl-c
and ctrl-z
has no affect.
ron
(8647 rep)
Jan 15, 2025, 01:31 PM
• Last activity: Jan 27, 2025, 04:10 PM
0
votes
1
answers
53
views
alternative to script(1) that produces clean typescripts of terminal sessions?
I am trying to capture a shell session (output of compilation of C program) and the terminal shows warnings and highlights variables in color in the terminal. See attached image. And when capturing the typescript of the session (to send output to someone else for debugging), the color is now (as exp...
I am trying to capture a shell session (output of compilation of C program) and the terminal shows warnings and highlights variables in color in the terminal. See attached image.
And when capturing the typescript of the session (to send output to someone else for debugging), the color is now (as expected) shown as terminal escape characters. But this only obscures the typescript and makes it difficult to read.
From reading the script(1) manpage I see there are no options to remove or eliminate this behaviour. Is there any alternative to script(1) that would record only commands and output and not commands that manipulate the screen?
Thanks in advance -- f
[fernan@host] script make.out
Script started, output log file is 'make.out'.
make; exit
Script started on 2025-01-22 14:36:56-03:00 [TERM="xterm-256color" TTY="/dev/pts/1" COLUMNS="209" LINES="52"]
^[[?2004h(base) ^[]0;fernan@rho: ~/phred-phrap-consed/phrap-cross_match-swat^G^[[01;32mfernan@host^[[00m:^[[01;34m~/phred-phrap-consed/phrap-cross_match-swat^[[00m$ make; exit^M
^[[?2004l^Mcc -O2 -c -o swat.o swat.c^M
^[[01m^[[Kswat.c:29:1:^[[m^[[K ^[[01;35m^[[Kwarning: ^[[m^[[Kreturn type defaults to ‘^[[01m^[[Kint^[[m^[[K’ [^[[01;35m^[[K^[]8;;https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wimplicit-int^G-Wimplicit-int^[]8;;^G^[[m^[[K]^M
29 | ^[[01;35m^[[Kcompare_scores^[[m^[[K(entry1, entry2)^M
| ^[[01;35m^[[K^~~~~~~~~~~~~~^[[m^[[K^M
^[[01m^[[Kswat.c:35:1:^[[m^[[K ^[[01;35m^[[Kwarning: ^[[m^[[Kreturn type defaults to ‘^[[01m^[[Kint^[[m^[[K’ [^[[01;35m^[[K^[]8;;https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wimplicit-int^G-Wimplicit-int^[]8;;^G^[[m^[[K]^M
35 | ^[[01;35m^[[Kcompare_z_scores^[[m^[[K(entry1, entry2)
[...]
truncated for clarity
[...]
exit
Script done.
[fernan@host]

fernan
(23 rep)
Jan 22, 2025, 06:08 PM
• Last activity: Jan 22, 2025, 06:45 PM
1
votes
2
answers
561
views
Running a process at startup and viewing its console output via ssh (or other means)
Is there a way I can have a process on a headless server which runs at startup, and still be able to connect remotely at a later time to view the console input? I need to be able to view console output via ssh or some other means. Simply redirecting output to a file won't work because these processe...
Is there a way I can have a process on a headless server which runs at startup, and still be able to connect remotely at a later time to view the console input? I need to be able to view console output via ssh or some other means.
Simply redirecting output to a file won't work because these processes never exit and constantly output lines. If I just redirect to a file it'll fill up the disk... (I only really care about the last 20 lines or so.)
I don't think "screen" is an option since I need run at boot time without interaction.
Manius
(171 rep)
Jun 8, 2021, 03:19 AM
• Last activity: Jan 14, 2025, 06:07 AM
11
votes
1
answers
22360
views
Where can I find the screenlog.0 file?
I have to run some scripts in a screen and I used the `C-a H` command to record the output to a `screenlog.0` file when I press the shortcut keys the message is `Logfile "screenlog.O" closed.` But if I try to find it with `locate screenlog.0` it doesn't show up. Where can I find the screenlog.0 file...
I have to run some scripts in a screen and I used the
C-a H
command to record the output to a screenlog.0
file when I press the shortcut keys the message is Logfile "screenlog.O" closed.
But if I try to find it with locate screenlog.0
it doesn't show up.
Where can I find the screenlog.0 file?
Eduard Florinescu
(12413 rep)
Apr 27, 2015, 01:09 PM
• Last activity: Jan 3, 2025, 11:43 AM
Showing page 1 of 20 total questions