This command is used to create a new session inside your current session. It typically is used to run long-running process. The process will continue to run even if current session is terminated whether due to bad connection or an exit. It can be used to log in to a specific session and resume the process where it’s left off.
General syntax for screen
command:
screen [OPTIONS] [SESSION NAME]
screen -S [file]
The -S
option creates a new window within the screen and names it.
Example: Let’s name our session “newexample” and start a new window.
screen -ls
This option displays all currently open windows, including those running in the background.
Example: Typing the screen -ls
command to display the number of screens available.
screen -r [filename]
Use this option to reattach a screen session which was detached in past.
Example: Reattaching the previously disconnected screen session named example.
screen -d [file]
The -d
option is used to detach the screen session, allowing it to be reattached later.
Example: Listing all currently attached screens and detaching the session named newfile.
screen -X [sharing_session]
This option allows two people to log into the same account from different locations.
Example: The user called username is logging into the ubuntu account and connecting to the screen session newexample.
The post How to Use the Screen Command in Linux appeared first on Hongkiat.
from Signage https://ift.tt/Vn9ELvo
via Irvine Sign Company