Home > Process Management > screen-list

screen-list: View Running Screen Sessions

The screen-list command displays a list of all currently running screen sessions in GNU Screen. This allows you to re-attach or manage detached sessions. It is commonly used in the form of 'screen -ls' or 'screen -list'.

Overview

screen-list lists all currently active or detached sessions in the GNU Screen multiplexer. It provides information such as each session's ID, name, and status (Attached/Detached), helping users manage their sessions easily.

Key Features

  • Displays a list of all currently running screen sessions.
  • Provides information on each session's unique ID, name, and status (Attached/Detached).
  • Offers information for re-attaching to detached sessions.

Main Options

screen-list is essentially the '-ls' or '-list' sub-option of the 'screen' command. Therefore, options of the 'screen' command itself can also be considered.

Display Session List

Generated command:

Try combining the commands.

Description:

`screen-list` Executes the command.

Combine the above options to virtually execute commands with AI.

Usage Examples

screen-list is primarily used in the form of 'screen -ls', and other screen commands are executed based on its output.

View All Screen Sessions

screen -ls

Check the ID, name, and status of all screen sessions currently running on the system.

Re-attach to a Specific Session (using ID)

screen -r 12345

Re-attach to a detached session using the session ID found with the command above. (e.g., session with ID 12345)

Re-attach to a Specific Session (using Name)

screen -r my_session_name

If you assigned a name when creating the session, you can re-attach to the detached session using that name. (e.g., session named 'my_session_name')

Installation

GNU Screen may not be installed by default on most Linux distributions. You can install it using the following commands.

Debian/Ubuntu

sudo apt update && sudo apt install screen

Install Screen using the APT package manager.

CentOS/RHEL/Fedora

sudo yum install screen
# or
sudo dnf install screen

Install Screen using the YUM or DNF package manager.

Tips & Notes

After checking sessions with screen-list, you can use the following tips for more efficient screen usage.

Useful Screen Commands

  • `screen -S [name]`: Creates a new screen session and assigns a name.
  • `Ctrl+a d`: Detaches the current screen session. The session continues to run in the background.
  • `exit` or `Ctrl+a k`: Terminates the current screen session.
  • `screen -wipe`: Cleans up a list of 'dead' sessions that no longer exist.

Importance of Naming Sessions

When using multiple screen sessions, assigning meaningful names with the `-S` option helps easily identify sessions in the `screen -ls` output and allows for quick re-attachment using `screen -r [name]`.


Same category commands