Skip to content

Instantly share code, notes, and snippets.

@hxtruong6
Created November 14, 2023 02:56
Show Gist options
  • Save hxtruong6/d8e94e32df521395e3bbcf858f5002d8 to your computer and use it in GitHub Desktop.
Save hxtruong6/d8e94e32df521395e3bbcf858f5002d8 to your computer and use it in GitHub Desktop.
Screen commnd

Screen

Screen package in Linux will create new terminal from current terminal and keep the connection without disconnect automatically.

install:

sudo apt-get update
sudo apt-get install screen

List all current screen: screen -ls

create new screen:

screen -S name -d -m -L

-S name: Specifies the session name as "name".

-d -m: Starts the screen session in detached mode.

-L: Enables logging.

So, this command creates a new screen session named "name," starts it in detached mode, and enables logging.

Enter a screen terminal (Detach and reattach to screen)

# Reattach
screen -r name
# Detach - Just exit current terminal screen - NOT close
# ctrl-a + ctrl-d
# control-a + control-d   (d=detach)

Exit - CLOSE SCREEN

exit
# or: control-a + control-k   (k=kill)

Written with StackEdit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment