How to use screen sessions in linux?
Step 0: Check if screen is installed
screen_check.sh
screenIf not run
install_screen.sh
sudo apt -y install screenStep 1: Create a screen session with a meaningful session name
create_screen_session.sh
screen -S sessionnameStep 2: Check if you are in a screen session
print_sty.sh
$ echo $STYIf the result is something like this:
example.txt
941609.sessionnameyou are currently in a session.
Step 3: Exit and terminate screen session
screen_exit.sh
$ exitStep 4: Exit and keep screen session running (detach)
screen_detach.sh
$ screen -dStep 5: See existing screen sessions
screen_list.sh
$ screen -lsStep 6: Reattach to existing screen sessions
screen_reattach.sh
$ screen -r sessionnameCheck out similar posts by category:
Linux
If this post helped you, please consider buying me a coffee or donating via PayPal to support research & publishing of new posts on TechOverflow