Screen is an application that allows a user to run multiple sessions within a single terminal window. This is handy if multiple programs are required to be run simultaneously by allowing the user to swap between different ‘screens’ to view the output. Another feature of screen is the ability to restore a remote session if a connection is lost. Using screen is a great habit to get into, especially when running tasks that require a longer running time, such as when installing updates or compiling software.

To install screen ensure your ports are up-to-date by running:
portsnap fetch update

After this completes you will need to change into the directory that the screen port is located:
cd /usr/ports/sysutils/screen

And then to install screen type:
make install clean

Screen will now be installed.

One example for using screen is so that you can restore a remote session if a connection is lost. To do this type in screen after logging in via ssh.

If the connection is lost, log back in via ssh and type screen -RD the session will be restore where you left off.

I hope you find this information useful!