Getting started with Raspbian Linux

This note assumes you have installed Raspbian Linux, the default RaspberryPi operating system and that you bought an RaspberryPi model B or B+ which has either a wired Internet connection or one of the USB WiFI dongles installed and that it is connected to your router.

Everything you need to know to use, manage or program a RaspberryPi, sometimes referred to as an RPi, is either documented on the system already or available online. Here's a rapid guide to the stuff that comes as part of the system. By and large this note covers command-line tools. Example commands are written on a separate line and are preceeded with '$ ', the command prompt for a normal Linux user. If you need to use root facilities and you login as root the prompt changes to '# '. Root is the Linux name for the superuser. You can also use these tools by prefixing the command with sudo and entering your password when prompted for it.

Searching for information

manpages
give (sometimes extensive) information about using a specific program, library function or configuration file. Entering the command:
$ man less
tells you how to use less, the standard paging text viewer. man is the command line tool used to display manpages, but you do need to know the name of the relevant manpage before man can display it. Manpage names are typically the same as the program, library function or configuration file they describe.
apropos
solves the problem of finding programs, library functions and their manpages when you don't know the name of the program or function. It is another command line tool that searches for matches in manpage titles, so
$ apropos compiler
will find all the manpages with a title line that contains 'compiler' and list their names together with the title line. That command finds 11 compiler-related manpages on my RPi. If apropos doesn't work, run mandb to set up the manpage index. Out of the box an RPi has a cron job that will run mandb every day to keep the index up to date, but you may need to run mandb manually from the command line on a new RPi:
sudo mandb
does the trick. Running:
$ man cron
tells you all about cron jobs and running
$ sudo less /etc/cron.daily/man-db
shows you the commands in the cron job. In the Linux world these executable text files are called shell scripts because they form a script that contains a list of commands for the command shell, the program that prompts for commands when you log in via SSH or start a terminal window.
locate
finds files. It is also a command line tool.
$ locate environ
will list all absolute file names that have 'environ' anywhere in their name, but as some queries can match hundreds of files, its often run with its output piped into less:
$ locate environ | less
On my RPi this lists 355 files: 10 belong to the system, the rest are mine. Like man, locate also relies on an index and won't work well unless updatedb is run regularly to refresh the index. locate and updatedb are not installed by default, but the command:
$ sudo apt-get install locate
will pull the locate package down from the internet and install it. The installation automatically sets up a daily cron job to run updatedb. As for apropos/mandb, if you want locate to work immediately after it has been installed, you'll need to run updatedb with sudo to build its index before locate can find anything.

Documentation

Useful Books

Just in case you prefer reading paper to going online...

O'Reilly books

Other books