The screen command usages and examples – Unix/Linux

By -

The screen command under the Unix is used to execute some process under or inside a screen. That means you can simply detach from the screen and keep working on that server. It is normally very helpful when you need to install some time consuming applications on the server. In this case, you can execute that installation on a screen. Then you may detach from screen, but the process is still running on that screen. After sometime you can re-attach that screen and control that process.

Here, I am explaining some common screen command usages and examples:

The command “screen“;
The command “screen” simply open a screen window for your process. You can execute the command over here and may detach from there.



Use Ctrl + AD(press CTRL+A followed by d) to detach from screen.

Or, you may open the screen with your process itself.

screen top


In this example, the top command will execute under the screen [Screen0].

Other important switches;
To view the screen

screen -x


root@jishnu [~]# screen -x
There are several suitable screens on:
        2294.pts-0.jishnu       (Detached)
        19946.pts-0.jishnu      (Detached)
Type "screen [-d] -r [pid.]" to resume one of them.


root@jishnu [~]# screen -x 19946.pts-0.jishnu

List all screens;

screen -ls


root@jishnu [~]#  screen -ls
There are screens on:
        2294.pts-0.jishnu       (Detached)
        19993.pts-0.jishnu      (Detached)
2 Sockets in /var/run/screen/S-root.

To attach to a running session;

screen -r


root@jishnu [~]# screen -r 19946.pts-0.jishnu

That’s it :-)

groupdel, groupmems, groupmod, useradd , usermod , chgrp, chown, ls, head, tail, top, ps, find, crontabftp commands, tar, rpm, rkhunter, Rsync, grep, netstat command switches, netstat command’s practical usages, OpenVZ commands, lsof command

Sr. Linux Server Admin, Infopark, Cochin, Kerala. Contact me : arun(at)

2 Comments to The screen command usages and examples – Unix/Linux

  1. Thank arun # screen top shows the running screens on the server am i right?, other way i real love this

    Thank u

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>