Original URL: http://www.theregister.co.uk/2008/10/28/netbook_linux_guide_2/

The netbook newbie's guide to Linux

One small step for Man...

By Chris Bidmead

Posted in Software, 28th October 2008 09:26 GMT

Episode Two This is a series about the Linux OS on netbooks, but we need to remind ourselves that these devices aren't personal computers. The personal computer is a machine you work on. Netbooks are essentially machines you work through, out into the Cloud.

It shouldn't matter what the operating system is. Or the hardware. Ideally, all your apps and your data are 'out there' in the Cloud, independent of any hardware or software you might use to access them. But design goals seldom accurately second guess the actual use to which things like these are put. We are treating these netbooks as low-cost PC - we are messing with the operating system and expecting to tailor them to our individual requirements. The legacy of the PC invites us to do so.

Eee PC with Linux

A corollary of this is that it would be idiotic to use these below-the-waterline adventures of ours either as evidence that netbooks are inadequate out of the box - or that Linux sucks.

Our first adventure took us down to the command line, where we explored a few of the available software tools. Linux is essentially layered like an onion: at the centre is the kernel, responsible for rudimentary connections to the hardware; wrapped round that are a set of Unix-like command-line software utilities; and on top of all this sits the GUI.

The three Small, Cheap Computers I'm juggling with at the moment: the Asus Eee PC 900, the MSI Wind and the Acer Aspire One (AA1). They all look as if they have completely different operating systems. Not so. The underlying kernels are virtually identical; the supplied software utilities are very similar but with some minor differences in their deployment.

Xandros
SuSE
Linpus

Different GUI, same foundations: the Eee PC's Xandros (top), MSI Wind's SuSE (middle) and Acer Aspire One's Linpus

The main difference is the GUI, itself a layered system, with some very remarkable properties. Which is why it makes sense to focus initially on those command line utilities, if only because they provide common ground across all the Linux systems we are looking at.

Open a terminal window in whichever version of Linux you are running and type pwd. This stands for 'print working directory', and the response you get will look something like this:

/home/user

This tells you that your current directory is called user, and is one level beneath the home directory, which is immediately off the topmost, 'root' directory, represented by the initial /. To get to a new directory we use the cd command we touched on last time, which stands for 'change directory', just as it does under DOS. To show the contents of the current working directory type ls, which is shorthand for 'list'.

Man man

Man Man

These commands - carried over from the original Unix on which Linux is modelled - are all characterised by brevity. Back in the day when you were having to enter all your commands from the keyboard there was an advantage to using as few keystrokes as possible. The GUI is often seen as a welcome release from this drudgery. But old hands - like Dave the Fingers - would point out that mouse excursions over the GUI can often be much more time and energy consuming, particularly when it sends you delving through layers of dialogue boxes, negotiating tabs and ticking boxes. A single command line incantation - assuming you know and can remember what it is - may get the same job done more quickly and more effectively.

But how did those old Unix guys remember all those esoteric commands? The answer: man. This three-letter command, standing for 'manual pages' gives the user systematic access to information about all the command-line operations, including the usually bewildering variety of parameters these commands accept.

Both SuSE Linux, supplied with the Wind, and the Xandros distro that comes with the Eee PC provide the man pages facility. Alas, it's missing from the AA1 . But that's very easily remedied. Last time, we saw how the yum package manager can be used to show what software is available on the machine and what can be added. It's not safe to add everything on the list, but let's see how we get on with the man pages.

Unix as Literature

Command line-averse users might do worse than read Thomas Scoville's article Unix as Literature here. It may not convert mouse-pushers, but it will at least give them some idea of where the key-tappers are coming from.

Firstly, let's see if the package we need is out there, and find out what it's called. So we run:

sudo yum list | grep man

This feeds the whole of the available software list through the grep filter looking for the three character string "man". You can look up grep once you have the man pages installed. You'll get a lot of results from the commads you just keyed in but among them you should find lines like the following:

Linux man listing

To interpret: man.i386 is the executable, designed for Intel's architecture, and the other available packages are the accompanying text files - no-arch because as essentially only text files they're tied to no particular architecture - in the various languages. If you're comfortable with English you'll probably now want to do the following:

sudo yum install man-pages-uk

Installation is a two-stage process. First, yum shows you what it's about to install, and tells you what size it is. At this point, you can respond with a 'Y' to proceed or an 'N' to abort.

This is followed by:

sudo yum install man

which will install the executable that allows you to view the manual files.

Office Work

If Microsoft Word is your only experience of wordprocessing, you're going to have to say goodbye to it when you pick up your Linux netbook. Likewise Excel. But all the SCCs I've seen come with Open Office, a free software equivalent that for the most part, I'm told, is every bit as good. I don't use either of these: for the past three years Google Docs - or its earlier manifestation, Writely.com - has been my office suite standby.

Google Docs

As a netbook user, Google Docs should probably be your word processor of choice too. It's a Cloud application, and it also maintains your data out on the net, and this is how netbooks are meant to work. Not only that, thanks to its sophisticated revisioning system Google Docs will store every version of every document you've written. So if I want to go back to the full-length version of a 1000-word article I wrote three years ago and eventually submitted as only 700 words, it's a snip to find it, compare it to the original, and pick out the 300 words that make up the difference.

My suggestion would be to start using Google Docs as your netbook's main wordprocessor straight away. Two snags may strike you: the CIA are reading everything you write; and it won't work if you're not online.

There's not much to be done about the first objection, but the second one is easily fixed. I'll be talking about Google Gears later on in the series.

Now AA1 users will have a full working manual pages facility. If the AA1 isn't your weapon of choice, this will at least give you some idea how a command-line package installer works. And with man on board we're now all singing from the same song sheet.

Root of the file system

The root of the file system

A logical first step might be man man - those old Unix guys really loved recursion! The spacebar will page-down through the output, and the 'b' key will move you back one page. 'g' takes you to the top of the document; 'G' takes you to the bottom. A particularly useful one is '/' followed by a string, which will search through the particular man page you're on for that string - and 'n' will take you to the next occurrence. You'll find these keys also work in less, which you encountered last time.

One really convenient way to use man pages, particularly if you're a beginner, is through apropos. This command is equivalent to evoking man with the -k parameter - or, in Unix-speak, it's an alias to man -k. It'll give you a list of all the man pages relevant to some particular topic. So if you type:

apropos text

you'll get a list of everything related to text. If the list overflows the window, you can usually use Shift PgUp and Shift PgDown to hop through the pages, although this depends on the nature of the terminal application you're running this in. And alternative is to use a pipe to less:

apropos text | less

But there's a good chance that none of this will work, and apropos (or man -k) will only return "nothing appropriate", particularly if you've only just installed the man pages. This is because apropos depends on an index of man pages that doesn't yet exist. There are two ways of making this index. On the MSI Wind and the Asus Eee PC, the command is mandb. AA1 users can create the index with the command makewhatis.

Root user

Who owns Root's root folder?

In all cases, you'll need to run this command as the so-called 'superuser', root, so this might be an appropriate point to discuss exactly what we mean by this. We touched on the root question last time, because this highest privilege level was necessary in order to install new software. The word means two different things in the context of Linux. First, it's the topmost directory in the directory hierarchy, represented with '/'. It's also the user with the highest system-access privileges. 'Uppermost' is the concept uniting these two ideas, although confusingly as a user root will usually have a home directory called root, which of course is not the same as /. An additional source of confusion lies in the fact that root is also the name of a privileged group of users, of which root is usually the only member.

Next Time... we'll take a closer look at those GUI interfaces and start exploring alternatives, and we'll have more to say about those text files under the hood that define features and functions.

The Important Bits

  • apropos - the command-line application for reading manual-page summaries.
  • apt-get - the command-line application installer on most Linux systems.
  • less - Linux's answer to DOS' More command, it breaks long output listings into pages.
  • makewhatis - the command-line application for indexing manual pages on the Aspire One.
  • man - the command-line application for reading manual pages.
  • mandb - the command-line application for indexing manual pages on most Linux systems.
  • Root - the nickname for the user with full access to a Linux system. Also the name of the top of the file hierarchy, which is written as /
  • sudo - the command that gives you run a second command as if you had full access to the system.
  • yum - the Acer Aspire One's command-line application installer.