Skip to content

Instantly share code, notes, and snippets.

@flavienbwk
Last active April 10, 2021 14:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save flavienbwk/231c57aebd8f0645a1481035a713ebe9 to your computer and use it in GitHub Desktop.
Save flavienbwk/231c57aebd8f0645a1481035a713ebe9 to your computer and use it in GitHub Desktop.
screen command tutorial

Using screen

Let's say you only have a terminal or a SSH access and want to perform multiple attached commands at the same time. E.g: wget.

Start a new screen

screen

Press enter to start using CLI and enter your command.

Detach the screen

To detach from your screen (and let the command run), press : Ctrl + a then d

List and re-attach running screens

screen -ls

You'll see a list of PIDs. If for example I want to take back the hand on 9623, I'll enter :

screen -r 9623

Kill the screen

Once finished, kill your screen with : Ctrl + a then k

Confirm pressing y

Lock your screen

You can lock your current screen with :

Ctrl + a then x

You current Linux user password will be asked

Switching between screens

When you do nested screen, you can switch between screen using command “Ctrl-A” and “n“. It will be move to the next screen. When you need to go to the previous screen, just press “Ctrl-A” and “p“.

To create a new screen window, just press “Ctrl-A” and “c“.

Credits

Simplified from tecmint.com

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