Horje
How to start screen in Linux

Here I will show starting screen work in Linux.

Linux Screen means when you will go offline then linux screen will run your work on VPS or Dedicated Server.

Open putty and Login to SSH


Check Screen Version

Run Following Command on Putty
Example: COMMAND
screen –version

Output should be:

Check Screen Version

Install Screen on Centos Linux Server if so far not installed

Run Following Command on Putty
Example: COMMAND
yum install screen

Install Screen on Debian or Ubuntu Linux Server if so far not installed

Run Following Command on Putty
Example: COMMAND
sudo apt install screen

Now, Start Screen on Linux

Run Following Command on Putty
Example: COMMAND
screen

List of Screens which are running in Linux Server

Run Following Command on Putty
Example: COMMAND
screen -ls

Go to listed Screen

Go to Listed Screen Replace id Run Following Command on Putty
Example: COMMAND
screen -r 1643

Remove or Stop running screen

To kill screen process. Just replace id from listing screen at following way. Run Following Command on Putty
Example: COMMAND
kill -9 985647

List of Command

Session Management:
  • screen: Start a new screen session.
  • screen -S <session_name>: Start a new screen session with a specific name.
  • screen -ls: List all running screen sessions.
  • screen -d <session_id>: Detach a specific screen session.
  • screen -r <session_id_or_name>: Reattach to a specific screen session.
  • screen -x: Attach to a running session if there is only one.
  • Ctrl-a d: Detach the current screen session.
  • Ctrl-a D: Power detach and logout from the current screen session.
  • `Ctrl-a Ctrl-\`: Quit screen and terminate all windows.
Window Management within a Session:
  • Ctrl-a c: Create a new window (shell) within the current session.
  • Ctrl-a w: List all windows within the current session.
  • Ctrl-a n: Go to the next window.
  • Ctrl-a p: Go to the previous window.
  • Ctrl-a <number>: Go to a specific window by its number (e.g., Ctrl-a 0 for the first window).
  • Ctrl-a Ctrl-a: Toggle between the current and previous window.
  • Ctrl-a A: Rename the current window.
  • Ctrl-a k: Kill (close) the current window.
Copy and Paste:
  • Ctrl-a [: Enter copy mode (use arrow keys to navigate, space to select text).
  • Ctrl-a ]: Paste the copied text.
Other Useful Commands:
  • screen --version: Display the screen version.
  • Ctrl-a ?: Display a list of screen commands (help).
  • Ctrl-a H: Toggle logging of the current window to a file.
  • Ctrl-a S: Split the window horizontally.
  • Ctrl-a |: Split the window vertically.
  • Ctrl-a Tab: Switch between split regions.
  • Ctrl-a X: Close the active split region.
  • Ctrl-a Q: Close all split regions.

Remove dead screens

To remove all killed Screens run following command at Terminal

Example: COMMAND
screen -wipe

Output should be:




How to start screen in Linux Image Gallery



Category:
Command
Sub Category:
Linux Screen Command
Uploaded by:
Admin