![Forrest logo](/images/logo.png)
screen:list
List all running screen sessions
$ screen -ls
try on your machine
The command "screen -ls" is used to list all the currently running "screen" sessions on a Linux or Unix-based operating system.
Here is a breakdown of the command:
- "screen" is a terminal multiplexer that allows you to run multiple shell sessions within a single terminal window or remotely detach and reattach to a session. It is commonly used to ensure that long-running processes continue even if the connection to the remote machine is interrupted.
- "-ls" is an option that stands for "list sessions." It instructs the "screen" command to display a list of all active screen sessions.
When you execute the "screen -ls" command, it will check for any screen sessions running on the machine and display information about each session, including a unique session ID, the attached terminal, and the title (if any) given to the session.
For example, the output of "screen -ls" might look like:
There are screens on:
7843.pts-0.hostname (Attached)
7919.pts-1.hostname (Detached)
2 Sockets in /var/run/screen/S-username.
This output indicates that there are two active screen sessions. One session is attached, meaning it is currently active and accessible. The other session is detached, meaning it was previously running but is now running in the background and can be reattached at any time.
This explanation was created by an AI. In most cases those are correct. But please always be careful and
never run a command you are not sure if it is safe.