GEOG5870/1M: Web-based GIS A course on web-based mapping

Linux: Introduction to Operating Systems

Linux is an operating system (OS), like Windows, but perhaps one that is somewhat simpler, and therefore somewhat easier to dig into and therefore have confidence in if you're the kind of person who likes to understand what is going on with computers. Because of this, it is often the OS of choice when it comes to building systems for the internet.

To understand Linux, and how we set it up, we first need to understand what an OS does. Essentially it:

As you can see, everything flows from the fact that the OS is the interface between software and a machine's hardware. This means the OS needs to match hardware, and this matching is often part of the install process.

As it happens, many of the lowest level connections between the two are handled by firmware that comes with the motherboard. For PCs, this is usually a Basic Input/Output System (BIOS) or, now, a Unified Extensible Firmware Interface (UEFI or EFI) program. These:

Most OSs then fall into two families. There's the Disk Operating System (DOS) family, the most notable example of which is Windows, and the UNiplexed Information and Computing Service (Unix) family ('UNIX-like', or '*nix'). This includes UNIX; Linux; and Apple's Mac(intosh) OS X.

Introduction to Linux

Essentially the *nix OSs are a central OS (the 'kernel') plus:

Terminals run 'shells': scripting environments with their own commands and user profile setup. As most UNIX-like systems are written in the programming language 'C', they work well with C as both a full language and (in 'C Shell') a scripting language for automating tasks.

*nix systems are often used for servers as:

Because of this, and their general simplicity/stability, the UNIX-like family are the backbone of the internet.

If you are used to Windows, there are some differences:

Linux itself was developed as a version of UNIX for PC hardware. It was started by Linus Torvald, a computing student at the University of Helsinki in early 90s. It is Open Source, so free. Linus also developed the Git system to manage development of the project by multiple people. Linux matches official UNIX standard: IEEE's POSIX (Portable Operating System Interface for Computer Environments), which keeps it similar to other *nix systems and familiar for those used to these, enhancing its popularity.

While all Linux distributions have the same core kernal, they differ in the software distributed with this, including GUIs, installation managers, etc. There are three broad families:

There are plenty of options within these families, including the core distributions:

Each comes with a default setup for various OS elements, though it is possible to switch them. The usual choices you need to make centre on Windows GUIs (based on X-Windows), usually either GNOME and/or KDE, and the shell you'll use, classically either: Bourne ("Bourne Again" on Linux); (Public Domain) Korn; or (T)C. By default most systems start in Bourne.

Running Linux

You essentially have three choices when running Linux. First, you can boot from a DVD/CD/USB (details; one option; another option; though most Linux distributions ('distros') will tell you how to do this). Secondly, you can run it within another OS like Windows, using a Virtual Machine which pretends to be a whole other computer on which you can install Linux; a commonly used virtual machine is Virtual Box. Finally, you can fully install a copy, either replacing whatever OS is installed on your machine, or getting a boot loader (and often a boot loader manager) to allow you to choose the OS to load (so-called "dual boot"). Most distros come with an installer which will walk you through the steps. You may need to burn the distribution to a 'bootable' CD to start with. There will be instructions wherever you download the distribution from.

However you install it, you'll need some space to write information to, if not also for the OS (one of the disadvantages of running from a disk is that often you can't save information). If you install the OS or run Virtual Box, you can give Linux its own harddrive or run it from a separate harddrive partition (a chunk of the harddrive). This is usually carved out of your free disk space, and often isn't then available to other OS, so this wants to be optimal; the installer will usually suggest how much to use. Usually you need at least a root partition (reserved for the OS), though sometimes also a boot partition for the boot loader and a swap partition for memory use. Other partitions then are available for users etc.

Partitions and disks will be 'mounted' so they appear as part of the same filesystem. You can also mount network disks. The filesystem starts at 'root', represented by a forward-slash /, but other disk space can be mounted within that, such as disk space for users mounted at /home.

If you've installed Linux on a PC with a screen, you'll usually be presented with either a shell, or, more usually, the default X-Windows environment. If, instead, you have a remote Linux machine somewhere on the network you want to contact, the best way is to open up a secure shell (SSH) connection to it - these allow you to send encrypted information across the network. The simplest PC software to do this is PuTTY. Although you can just send text across SSH, you can also 'tunnel' across the SSH to connect with X-Windows. To transfer files, use sftp (secure ftp). A good Windows client is Filezilla.

If you're presented with a shell, the usual thing is to log in as the default user. Details of this will be on the distro website. These usually have a default or no password, so if your machine is going to be online you should change that as soon as possible using the passwd command at a shell prompt (instructions). Once you log in, most distros will boot X-Windows by default.

The default user account will usually be limited in what it can do. There is a second account that you can use to install software and administer the computer etc., called the superuser account. The name of this account is "root". Again, there will either be a known password or no password, in which case you should give it one (if you do, don't forget it or you are likely to have to reinstall). You can log in directly as root, however it is more usual to log in as the superuser from another account, minimising the time spent as root to just the time needed. You can log in using the "su" (switch user) command on its own at a command line (to exit, type "exit"). Alternatively you can run a single command by starting it "sudo" and then a space and the command. Both should ask for the password if there is one; sudo will usually ask for *your* password, rather than root's, if you are a user with sudo rights.


[ Next: Working at the command line]