tmux vs screen
Due to I have many services and servers on Raspberry Pi I need to spend some time after turning on and relaunching the RPi to start every service and server.
It emerged that screen is pretty good solution to my problem because it allows to run scripts and programs on boot of device1.
Before this I was always using tmux but its functionality doesn’t allow doing so – user has to login to launch every script and program in background tmux-sessions like I needed.
About tmux:
- Create new session:
tmux new -s <name>
- Hide the session (detach from it):
Ctrl+B
thenD
- List all sessions:
tmux ls
- Attach to session:
tmux a -t <name>
- Close the session:
Ctrl+B
thenX
About screen:
- Run the command on background:
screen -dmS <screen_name> "<command>"
- Run the sequence of programs in background:
screen -dmS <screen_name> bash -c "<command1>; <command2>; <command3>;"
- Hide the session (detach from it):
Ctrl+A
thenD
- List all sessions:
screen -list
- Attach to session:
screen -x <screen_name>
- Close running in
<screen_name>
program:screen -S <screen_name> -X quit
- Running the scripts and programs in background on boot at
homebridge
repository - More about
screen
command on Ubuntu - tmux vs screen on Reddit’e
-
Running the scripts and programs in background on boot at
homebridge
repository ↩
Leave a comment