Reader small image

You're reading from  Raspberry Pi Computer Architecture Essentials

Product typeBook
Published inMar 2016
Reading LevelIntermediate
Publisher
ISBN-139781784397975
Edition1st Edition
Languages
Right arrow
Authors (2):
Andrew K. Dennis
Andrew K. Dennis
author image
Andrew K. Dennis

Andrew K. Dennis is a full stack and cybersecurity architect with over 17 years' experience who currently works for Modus Create in Reston, VA. He holds two undergraduate degrees in software engineering and creative computing and a master's degree in information security. Andy has worked in the US, Canada, and the UK in software engineering, e-learning, data science, and cybersecurity across his career, and has written four books on IoT, the Raspberry Pi, and supercomputing. His interests range from the application of pataphysics in computing to security threat modeling. Andy lives in New England and is an organizer of Security BSides CT.
Read more about Andrew K. Dennis

View More author details
Right arrow

Installing Screen and Vim


Two useful tools to install on your Raspberry Pi 2 are Screen—a terminal multiplexor—and Vim—a text editor.

We will be installing these via a package management tool called apt-get. A package management tool is used for installing extra software onto your operating system. It makes the process easy by keeping track of and downloading any libraries or dependencies needed by the software. It also makes upgrades and removal quite simple.

You can read more about apt-get at http://linux.die.net/man/8/apt-get.

Before installing Screen and Vim you should update the cache of the apt-get repository. This can be done by running the following command:

sudo apt-get update

We are now ready to install our terminal multiplexor.

We will start by installing Screen. This will allow you to keep multiple bash shells open when you login and out of your Raspberry Pi, so you can leave applications running while you are not directly connected to the device.

Note

The Bourne Again Shell (bash) is the shell used in Raspbian by default. You can read more about it here: https://www.gnu.org/software/bash/

To install Screen you can use the apt-get package manager:

sudo apt-get install screen

Once installation is complete, to run Screen you simply type the following command:

screen

The Screen application will now load, allowing you to create multiple windows containing bash sessions. To create a new window in the screen session type the following command:

Ctrl + a then c

If you want to remove a window you can kill it. The command to do this is as follows:

Ctl + a then k

When you have multiple windows open you will want to navigate between them. To move between each open window use the following command:

Ctrl + a then num #where num is the screen number, for example 1 or 3

To give the screens window a user friendly name type this command:

Ctrl + a then Shift + a.

This will give you a prompt where you can label the window for ease of use.

To detach from a screen session type the following command:

Ctrl + a then d

To re-attach you can then type this command:

screen –x

If more than one screen session is open, type the ID in after the -x, for example:

screen –x 1234

More information can be found at https://www.gnu.org/software/screen/manual/screen.html.

By default, the Screen application is very plain looking. However, its look and feel can be modified through a .screenrc file.

To learn more about this process, check out the gnu.org site's section on customizing screen at https://www.gnu.org/software/screen/manual/html_node/Customization.html#Customization.

Vim – an optional handy text editor

In addition to the text editors installed by default with Raspbian, you may also wish to install Vim, a powerful text-editing tool. You will see this tool referenced later in this book, so you may find it easier to follow along if you install this.

To install it via our package manager run the following command:

sudo apt-get install vim

Vim is a complex tool but if you persist with it, you will find it rewarding. A guide can be found here: http://vimhelp.appspot.com/.

Finally, there are a number of other text editors worth exploring if you wish. You can find a list at the official Raspberry Pi website here: https://www.raspberrypi.org/documentation/linux/usage/text-editors.md.

Previous PageNext Page
You have been reading a chapter from
Raspberry Pi Computer Architecture Essentials
Published in: Mar 2016Publisher: ISBN-13: 9781784397975
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
undefined
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime

Authors (2)

author image
Andrew K. Dennis

Andrew K. Dennis is a full stack and cybersecurity architect with over 17 years' experience who currently works for Modus Create in Reston, VA. He holds two undergraduate degrees in software engineering and creative computing and a master's degree in information security. Andy has worked in the US, Canada, and the UK in software engineering, e-learning, data science, and cybersecurity across his career, and has written four books on IoT, the Raspberry Pi, and supercomputing. His interests range from the application of pataphysics in computing to security threat modeling. Andy lives in New England and is an organizer of Security BSides CT.
Read more about Andrew K. Dennis