wunder · Library

Section 2.3.2 on Page [*] If You’re Not Sure How Large It Should Be.

Debian Gnu/linux : Guide to Installation and Usage · John Goerzen — chapter 5 of 8 · ~22,528 words · public domain

Read in the Wunder reader — free

Remember to leave enough space for your swap partition (see section 2.3.5 on page [*]). Enter the parition size you want and then press Enter. Next you will be asked if you want to place the partition at the beginning of free space or at the end. Place it at the beginning to help ensure that it lies within the first 1,024 cylinders. Highlight “Beginning” and press Enter. At this point you will be brought back to the main screen. Notice that the partition you created is listed. By default, a Linux native partition was created. This partition must now be made bootable. Make sure that the “Bootable” menu selection is highlighted and press Enter. The partition should now have the word “Boot” listed under the “Flags” column.

With the remaining space, create another primary partition. Using the down-arrow key, highlight the free space entry in the partition list. Now highlight the “New” menu selection and proceed just as you did when you created the first primary partition. Notice that the partition is listed as a Linux native partition. Because this partition will be your swap partition, it must be denoted as such. Make sure the partition you just created (your swap partition) is highlighted and then press the left-arrow key until the “Type” menu selection is highlighted, then press Enter. You will be presented with a list of supported partition types. The Linux swap partition type should already be selected. If it is not, enter the number from the list that corresponds to the Linux swap partition (82), and then press Enter. Your swap partition should now be listed as a Linux swap partition under the “FS Type” column in the main screen.

Your cfdisk screen should look something like the screenshot in Figure 3.1 on page [*]. The numbers may not be the same, but the Flags and FS Type column shoulds be similar.

Until now, nothing on your disk has been altered. If you are satisfied that the partition scheme you created is what you want, press the left-arrow key until “Write” is highlighted, and press Enter. Your hard disk has now been partitioned. Quit the cfdisk application by selecting the “Quit” menu selection. Once you have left cfdisk, you should be back in Debian’s dbootstrap installation application.

3.6 Initialize and Activate a Swap Partition

This will be the “Next” menu item once you have created one disk partition. You have the choice of initializing and activating a new swap partition, activating a previously-initialized one, or doing without a swap partition.

A swap partition is strongly recommended, but you can do without one if you insist and if your system has more than 4MB RAM. If you wish to do this, select the “Do Without a Swap Partition” item from the menu and move on to the next section.

It’s always permissible to reinitialize a swap partition, so select “Initialize and Activate a Swap Partition” unless you are sure you know what you are doing. This menu choice will first present you with a dialog box reading “Please select the partition to activate as a swap device.” The default device presented should be the swap partition you’ve already set up; if so, just press Enter.

Next you have the option to scan the entire partition for unreadable disk blocks caused by defects on the surface of the hard disk platters. This is useful if you have MFM, RLL, or older SCSI disks, and it never hurts (although it can be time-consuming). Properly working disks in most modern systems don’t require this step, because they have their own internal mechanisms for mapping out bad disk blocks.

Finally, there is a confirmation message because initialization will destroy any data previously on the partition. If all is well, select “Yes.” The screen will flash as the initialization program runs.

3.7 Initialize a Linux Partition

At this point, the next menu item presented should be “Initialize a Linux Partition.” If it isn’t, either you haven’t completed the disk partitioning process, or you haven’t made one of the menu choices dealing with your swap partition.

You can initialize a Linux partition, or alternately you can mount a previously initialized one. Note that dbootstrap will not upgrade an old system without destroying it. If you’re upgrading, Debian can usually upgrade itself, and you won’t need to use dbootstrap. The Debian 2.1 release notes contain upgrade instructions.

http://www.debian.org/releases/slink/i386/release-notes/ch-upgrading- req.en.html

If you are using old disk partitions that are not empty, i.e., if you want to just throw away what is on them, you should initialize them (which erases all files). Moreover, you must initialize any partitions that you created in the disk partitioning step. About the only reason to mount a partition without initializing it at this point would be to mount a partition upon which you have already performed some part of the installation process using this same set of installation floppies.

Select the “Next” menu item to initialize and mount the / disk partition. The first partition that you mount or initialize will be the one mounted as / (pronounced “root”). You will be offered the choice to scan the disk partition for bad blocks, as you were when you initialized the swap partition. It never hurts to scan for bad blocks, but it could take 10 minutes or more to do so if you have a large disk.

Once you’ve mounted the / partition, the “Next” menu item will be “Install Operating System Kernel and Modules” unless you’ve already performed some of the installation steps. You can use the arrow keys to select the menu items to initialize or to mount disk partitions if you have any more partitions to set up. If you have created separate partitions for /var, /usr, or other filesystems, you should initialize or mount them now.

3.7.1 Mount a Previously-Initialized Partition

An alternative to the “Initialize a Partition” step is the “Mount a Previously-Initialized Partition” step. Use this if you are resuming an installation that was interrupted or if you want to mount partitions that have already been initialized.

3.8 Install Operating System Kernel and Modules

This should be the next menu step after you’ve mounted your root partition, unless you’ve already performed this step in a previous run of dbootstrap. First, you will be asked to confirm that the device you have mounted on root is the proper one. Next, you will be offered a menu of devices from which you can install the kernel. Choose the appropriate device from which to install the kernel and modules; this will either be a CD-ROM device or the first floppy device.

If you’re installing from floppies, you’ll need to feed in the Rescue Floppy (which is probably already in the drive), followed by the Drivers Floppy.

3.9 Configure PCMCIA Support

There is an alternate step, before the “Configure Device Driver Modules” menu selection, called “Configure PCMCIA Support.” This menu is used to enable PCMCIA support.

If you do have PCMCIA but are not installing your Debian system using it (i.e., installation with a PCMCIA Ethernet card), you need not configure PCMCIA at this point. You can easily configure and enable PCMCIA at a later point, after installation is complete. However, if you are installing by way of a PCMCIA network device, this alternate must be selected, and PCMCIA support must be configured prior to configuring the network.

If you need to install PCMCIA, select the alternate below “Configure Device Driver Modules.” You will be asked which PCMCIA controller your system contains. In most cases, this will be i82365. In some cases, it will be tcic; your laptop’s vendor-supplied specifications should provide the information. You can generally leave the next few sets of options blank. Again, certain hardware has special needs; the Linux PCMCIA HOWTO contains plenty of information in case the default doesn’t work.

http://metalab.unc.edu/LDP/HOWTO/PCMCIA-HOWTO.html

In some unusual cases, you may also need to modify the file /etc/pcmcia/config.opts. You can open your second virtual terminal (Left Alt-F2) and edit the file there and then reconfigure your PCMCIA, or you can manually force a reload of the modules using insmod and rmmod.

Once PCMCIA is properly configured and installed, you should configure your device drivers as described in the next section.

3.10 Configure Device Driver Modules

Select the “Configure Device Driver Modules” menu item and look for devices that are on your system. Configure those device drivers, and they will be loaded whenever your system boots.

You don’t have to configure all your devices at this point; what is crucial is that any device configuration required for the installation of the base system is done here.

At any point after the system is installed, you can reconfigure your modules with the modconf program.

3.11 Configure the Network

You’ll have to configure the network even if you don’t have a network, but you’ll only have to answer the first two questions—“Choose the Host name,” and “Is your system connected to a network?”

If you are connected to a network, you’ll need the information you collected from 2.2.1. However, if your primary connection to the network will be PPP, you should choose NOT to configure the network.

dbootstrap will ask you a number of questions about your network; fill in the answers from 2.2.1. The system will also summarize your network information and ask you for confirmation. Next, you need to specify the network device that your primary network connection uses. Usually, this will be eth0 (the first Ethernet device). On a laptop, it’s more likely that your primary network device is pcmcia.

Here are some technical details you may find handy: The program assumes the network IP address is the bitwise AND of your system’s IP address and your netmask. It will guess the broadcast address is the bitwise OR of your system’s IP address with the bitwise negation of the netmask. It will guess that your gateway system is also your DNS server. If you can’t find any of these answers, use the system’s guesses. You can change them once the system has been installed, if necessary, by editing /etc/init.d/network. (On a Debian system, daemons are started by /scripts in the directory /etc/init.d/.)

3.12 Install the Base System

During the “Install the Base System” step, you’ll be offered a menu of devices from which you may install the base system. Here, you need to select your CD-ROM device.

You will be prompted to specify the path to the base2_1.tgz file. If you have official Debian media, the default value should be correct. Otherwise, enter the path where the base system can be found, relative to the media’s mount point. As with the “Install Operating System Kernel and Modules” step, you can either let dbootstrap find the file itself or type in the path at the prompt.

3.12.1 Configure the Base System

At this point you’ve read in all of the files that make up a minimal Debian system, but you must perform some configuration before the system will run.

You’ll be asked to select your time zone. There are many ways to specify your time zone; we suggest you go to the “Directories:” pane and select your country (or continent). That will change the available time zones, so go ahead and select your geographic locality (i.e., country, province, state, or city) in the “Timezones:” pane.

Next, you’ll be asked if your system clock is to be set to GMT or local time. Select GMT (i.e., “Yes”) if you will only be running Linux on your computer; select local time (i.e., “No”) if you will be running another operating system as well as Debian. Unix (and Linux is no exception) generally keeps GMT time on the system clock and converts visible time to the local time zone. This allows the system to keep track of daylight savings time and leap years, and even allows a user who is logged in from another time zone to individually set the time zone used on his or her terminal.

3.12.2 Make Linux Bootable Directly from the Hard Disk

If you elect to make the hard disk boot directly to Linux, you will be asked to install a master boot record. If you aren’t using a boot manager (and this is probably the case if you don’t know what a boot manager is) and you don’t have another different operating system on the same machine, answer “Yes” to this question. Note that if you answer “Yes,” you won’t be able to boot into DOS normally on your machine, for instance. Be careful. If you answer “Yes,” the next question will be whether you want to boot Linux automatically from the hard disk when you turn on your system. This sets Linux to be the bootable partition—the one that will be loaded from the hard disk.

Note that multiple operating system booting on a single machine is still something of a black art. This book does not even attempt to document the various boot managers, which vary by architecture and even by sub-architecture. You should see your boot manager’s documentation for more information. Remember: When working with the boot manager, you can never be too careful.

The standard i386 boot loader is called “LILO.” It is a complex program that offers lots of functionality, including DOS, NT, and OS/2 boot management. To find out more about this functionality, you can read the documentation in /usr/doc/lilo after your system is set up.

3.13 Make a Boot Floppy

You should make a boot floppy even if you intend to boot the system from the hard disk. The reason is that it’s possible for the hard disk bootstrap to be mis-installed, but a boot floppy will almost always work. Select “Make a Boot Floppy” from the menu and feed the system a blank floppy as directed. Make sure the floppy isn’t write-protected, because the software will format and write it. Mark this the “Custom Boot” floppy and write-protect it once it has been written.

3.14 The Moment of Truth

You system’s first boot on its own power is what electrical engineers call the “smoke test.” If you have any floppies in your floppy drive, remove them. Select the “Reboot the System” menu item.

If are booting directly into Debian and the system doesn’t start up, either use your original installation boot media (for instance, the Rescue Floppy) or insert the Custom Boot floppy if you created one, and then reset your system. If you are not using the Custom Boot floppy, you will probably need to add some boot arguments. If booting with the Rescue Floppy or similar technique, you need to specify rescue root=rootfs, where rootfs is your root partition, such as /dev/sda1.

Debian should boot, and you should see the same messages as when you first booted the installation system, followed by some new messages.

3.15 Set the Root Password

The root account is also called the superuser; it is a login that bypasses all security protection on your system. The root account should be used only to perform system administration and for as short a time as possible.

Any password you create should contain from six to eight characters, and it should contain both uppercase and lowercase characters, as well as punctuation characters. Take extra care when setting your root password, since it is such a powerful account. Avoid dictionary words or use of any personal information that could be guessed.

If anyone ever tells you he needs your root password, be extremely wary. You should normally never give out your root account, unless you are administering a machine with more than one system administrator.

3.16 Create an Ordinary User

The system will ask you to create an ordinary user account. This account should be your main personal login. You should not use the root account for daily use or as your personal login.

Why not? It’s a lot harder to do damage to the system as an ordinary user than as root; system files are protected. Another reason is that you might be tricked into running a Trojan horse program—that is, a program that takes advantage of your superuser powers to compromise the security of your system behind your back. Any good book on Unix system administration will cover this topic in more detail. Consider reading one if this topic is new to you.

Name the user account anything you like. If your name is John Smith, you might use “smith,” “john,” “jsmith,” or “js.”

3.17 Shadow Password Support

Next, the system will ask whether you want to enable shadow passwords. This is an authentication system that makes your Linux system a bit more secure. Therefore, we recommend that you enable shadow passwords. Reconfiguration of the shadow password system can also be done later with the shadowconfig program.

3.18 Remove PCMCIA

If you have no use for PCMCIA, you can choose to remove it at this point. This will make your startup cleaner; also, it will make it easier to replace your kernel (PCMCIA requires a lot of correlation between the version of the PCMCIA drivers, the kernel modules, and the kernel itself). In general, you will not need PCMCIA unless you’re using a laptop.

3.19 Select and Install Profiles

The system will now ask you if you want to use the pre-rolled software configurations offered by Debian. You can always choose package-by-package what you want to install on your new machine. This is the purpose of the dselect program, described below. But this can be a long task with the thousands of packages available in Debian!

So, you have the ability to choose tasks or profiles instead. A task is work you will do with the machine, such as “Perl programming” or “HTML authoring” or “Chinese word processing.” You can choose several tasks. A profile is a category your machine will be a member of, such as “Network server” or “Personal workstation.” Unlike with tasks, you can choose only one profile.

To summarize, if you are in a hurry, choose one profile. If you have more time, choose the Custom profile and select a set of tasks. If you have plenty of time and want very precise control on what is or is not installed, skip this step and use the full power of dselect.

Soon, you will enter into dselect. If you selected tasks or profiles, remember to skip the “Select” step of dselect, because the selections have already been made.

A word of warning about the size of the tasks as they are displayed: The size shown for each task is the sum of the sizes of its packages. If you choose two tasks that share some packages, the actual disk requirement will be less than the sum of the sizes for the two tasks.

Once you’ve added both logins (root and personal), you’ll be dropped into the dselect program. dselect allows you to select packages to be installed on your system. If you have a CD-ROM or hard disk containing the additional Debian packages that you want to install on your system, or if you are connected to the Internet, this will be useful to you right away. Otherwise, you may want to quit dselect and start it later after you have transported the Debian package files to your system. You must be the superuser (root) when you run dselect. Information on how to use dselect is given in section 3.20.

3.20 Package Installation with dselect

It is now time to install the software packages of your choice on your Debian system. This is done using Debian’s package management tool, dselect.

3.20.1 Introduction

This section documents dselect for first-time users. It makes no attempt to explain everything, so when you first meet dselect, work through the help screens.

dselect is used to select which packages you wish to install (there are currently about 2,250 packages in Debian 2.1). It will be run for you during the installation. It is a very powerful and somewhat complex tool. As such, having some knowledge of it beforehand is highly recommended. Careless use of dselect can wreak havoc on your system.

dselect will step you through the package installation process outlined here:

1. Choose the access method to use. 2. Update list of available packages, if possible. 3. Select the packages you want on your system. 4. Install and upgrade wanted packages. 5. Configure any packages that are unconfigured. 6. Remove unwanted software.

As each step is completed successfully, dselect will lead you on to the next. Go through them in order without skipping any steps.

Here and there in this document we talk of starting another shell. Linux has six console sessions or shells available at any one time. You switch between them by pressing Left Alt-F1 through Left Alt-F6, after which you log in on your new shell and go ahead. The console used by the install process is the first one, a.k.a. tty1, so press Left Alt-F1 when you want to return to that process.

3.20.2 Once dselect Is Launched

Once in dselect, you will get this screen:

Debian Linux ‘dselect’ package handling frontend. 0. ccess Choose the access method to use. 1. pdate Update list of available packages, if possible. 2. elect Request which packages you want on your system. 3. nstall Install and upgrade wanted packages. 4. onfig Configure any packages that are unconfigured. 5. emove Remove unwanted software. 6. uit Quit dselect.

Let’s look at these one by one.

Access

Here we tell dselect where our packages are. Ignore the order that these appear in. It is very important that you select the proper method for installation. You may have a few more methods listed, or a few less, or you may see them listed in a different order; just don’t worry about it. In the following list, we describe the different methods.

multi_cd. Quite large and powerful, this complex method is the recommended way of installing a recent version of Debian from a set of multiple binary CDs. Each of these CDs should contain information about the packages in itself and all prior CDs (in the file Packages.cd). When you first select this method, be sure the CD-ROM you will be using is not mounted. Place the last binary disk of the set (we don’t need the source CDs) in the drive and answer the questions you are asked:

CD-ROM drive location Confirmation that you are using a multi-cd set The location of the Debian distribution on the disk(s) [ Possibly ] the location(s) of the Packages file(s)

Once you have updated the available list and selected the packages to be installed, the multi_cd method diverges from normal procedure. You will need to run an “install” step for each of the CDs you have, in turn. Unfortunately, due to the limitations of dselect, it will not be able to prompt you for a new disk at each stage; the way to work for each disk is outlined here:

1. Insert the CD in your CD-ROM drive. 2. From the main dselect menu, select “Install.” 3. Wait until dpkg finishes installing from this CD. (It may report installation successful, or possibly installation errors. Don’t worry about these until later.) 4. Press Return to go back to the main dselect menu. 5. Repeat with the next CD in the set.

It may be necessary to run the installation step more than once to cover the order of package installation; some packages installed early may need to have later packages installed before they will configure properly.

Running a “Configure” step is recommended to help fix any packages that may end up in this state.

multinfs, multimount. These are similar to the multicd method and are refinements on the theme of coping with changing media—for example, installing from a multicd set exported via NFS from another machine’s CD-ROM drive. indexdselect!multi-NFS, multi-mount installation

apt. One of the best options for installation from a local mirror of the Debian archive or from the network. This method uses the “apt” system to do complete dependency analysis and ordering, so it’s most likely to install packages in the optimal order.

Configuration of this method is straightforward. You may select any number of different locations, mixing and matching file: URLs (local disks or NFS mounted disks), http: URLs, or ftp: URLs. Note, however, that the HTTP and FTP options do not support local authenticating proxies.

If you have proxy server for either HTTP or FTP (or both), make sure you set the httpproxy and ftpproxy environment variables, respectively. Set them from your shell before starting dselect by using the following command:

# export http_proxy=http://gateway:3128/ # # dselect # # # # Update

dselect will read the Packages or Packages.gz files from the mirror and create a database on your system of all available packages. This may take a while as it downloads and processes the files.

Select

Hang on to your hat. This is where it all happens. The object of the exercise is to select just which packages you wish to have installed.

Press Enter. If you have a slow machine, be aware that the screen will clear and can remain blank for 15 seconds. So don’t start bashing keys at this point.

The first thing that comes up on the screen is page 1 of the Help file. You can get to this help by pressing ? at any point in the “Select” screens, and you can page through the help screens by hitting the . (full stop) key.

Before you dive in, note these points:

◼ To exit the “Select” screen after all selections are complete, press Enter. This will return you to the main screen if there is no problem with your selection. Otherwise, you will be asked to deal with that problem. When you are happy with any given screen, press Enter to get out. ◼ Problems are quite normal and are to be expected. If you select package A and that package requires package B to run, dselect will warn you of the problem and will most likely suggest a solution. If package A conflicts with package B (i.e., if they are mutually exclusive), you will be asked to decide between them.

Let’s look at the top two lines of the Select screen. This header reminds us of some of the special keys listed in Table 3.1.

Table 3.1: Special dselect keys +------------------------------------------------------+ | Key | Description | |------+-----------------------------------------------| | + | Select a package for installation. | |------+-----------------------------------------------| | = | Place a package on hold | |------+-----------------------------------------------| | - | Remove a package. | |------+-----------------------------------------------| | _ | Remove a package and its configuration files. | |------+-----------------------------------------------| | i, I | Toggle/cycle information displays. | |------+-----------------------------------------------| | o, O | Cycle through the sort options. | |------+-----------------------------------------------| | v, V | A terse/verbose toggle. | +------------------------------------------------------+

Table 3.2 lists the states that dselect uses to denote the status of each package it is aware of.

Table 3.2: dselect Package States +-----------------------------------------------+ | Flag | Meaning | Possible values | |------+-----------------+----------------------| | E | Error | Space, R, I | |------+-----------------+----------------------| | I | Installed State | Space, *, -, U, C, I | |------+-----------------+----------------------| | O | Old Mark | *, -, =, , n | |------+-----------------+----------------------| | M | Mark | *, -, =, , n | +-----------------------------------------------+

Rather than spell all this out here, I refer you to the Help screens where all is revealed. One example, though.

You enter dselect and find a line like this:

EIOM Pri Section Package Description ** Opt misc loadlin a loader (running under DOS) for LINUX

This is saying that loadlin was selected when you last ran dselect and that it is still selected, but it is not installed. Why not? The answer must be that the loadlin package is not physically available. It is missing from your mirror.

The information that dselect uses to get all the right packages installed is buried in the packages themselves. Nothing in this world is perfect, and it does sometimes happen that the dependencies built into a package are incorrect, which means that dselect simply cannot resolve the situation. A way out is provided where the user can regain control; it takes the form of the commands Q and X, which are available in the Select screen.

Q An override. Forces dselect to ignore the built-in dependencies and to do what you have specified. The results, of course, will be on your own head.

X Use X if you get totally lost. It puts things back the way they were and exits.

Select screen (dselect) Keys that help you not to get lost (!) are R, U, and D.

R Cancels all selections at this level. Does not affect selections made at the previous level.

U If dselect has proposed changes and you have made further changes U will restore dselect’s selections.

D Removes the selections made by dselect, leaving only yours.

An example follows. The boot-floppies package (not an example for beginners, I know, but it was chosen because it has a lot of dependencies) depends on these packages:

◼ libc6-pic ◼ slang1-pic ◼ sysutils ◼ makedev ◼ newt0.25 ◼ newt0.25-dev ◼ popt ◼ zlib1g ◼ zlib1g-dev ◼ recode

The person maintaining boot-floppies also thinks that the following packages should be installed. These are not, however, essential:

◼ lynx ◼ debiandoc-sgml ◼ unzip

When you select boot-floppies, dselect brings up the conflict resolution screen. You’ll notice that all the required packages have been selected.

Pressing the R key puts things back to the starting point.

EIOM Pri Section Package Description _ Opt admin boot-floppie Scripts to create the Debian Opt devel newt0.25-dev Developer’s toolkit for newt Opt devel slang1-dev The S-Lang programming library _ Opt devel slang1-pic The S-Lang programming library

If you decide now that you don’t want boot-floppies, just press Enter.

Pressing the D key puts things the way I selected them in the first place:

EIOM Pri Section Package Description _* Opt admin boot-floppie Scripts to create the Debian

_ Opt devel newt0.25-dev Developer’s toolkit for newt Opt devel slang1-dev The S-Lang programming library _ Opt devel slang1-pic The S-Lang programming library

Pressing the U key restores dselect’s selections:

EIOM Pri Section Package Description * Opt admin boot-floppie Scripts to create the Debian installation * Opt devel newt0.25-dev Developer’s toolkit for newt * Opt devel slang1-dev The S-Lang programming library * Opt devel slang1-pic The S-Lang programming library

I suggest running with the defaults for now; you will have ample opportunities to add more later.

Whatever you decide, press Enter to accept and return to the main screen. If this results in unresolved problems, you will be bounced right back to another problem resolution screen.

The R, U, and D keys are very useful in “what if” situations. You can experiment at will and then restore everything and start again. Don’t look on them as being in a glass box labeled “Break in Case of Emergency.”

After making your selections in the Select screen, press I to give you a big window, press t to take you to the beginning, and then use the Page Down key to look quickly through the settings. This way you can check the results of your work and spot glaring errors. Some people have deselected whole groups of packages by mistake and not noticed the error until too late. dselect is a very powerful tool; don’t misuse it.

You should now have the situation shown in Table 3.3.

Table 3.3: Expected Package Category States +--------------------------------------+ | Package category | Status | |------------------+-------------------| | Required | all selected | |------------------+-------------------| | Important | all selected | |------------------+-------------------| | Standard | mostly selected | |------------------+-------------------| | Optional | mostly deselected | |------------------+-------------------| | Extra | mostly deselected | +--------------------------------------+

Happy? Press Enter to exit the Select process. You can come back and run Select again if you wish.

Install

dselect runs through the entire set of packages and installs those selected. Expect to be asked to make decisions as you go. It is often useful to switch to a different shell to compare, say, an old configuration with a new one. If the old file is conf.modules, the new one will be conf.modules.dpkg-dist.

The screen scrolls past fairly quickly on a fast machine. You can stop and start it with Ctrl-s and Ctrl-q, respectively, and at the end of the run, you will get a list of any uninstalled packages.

It can happen that a package does not get installed because it depends on some other package that is listed for installation but is not yet installed. The answer here is to run Install again. Cases have been reported where it was necessary to run it four times before everything slipped into place. This will vary by your acquisition method.

Configure

Most packages get configured in step 3, but anything left hanging can be configured here.

Remove

Removes packages that are installed but no longer required.

Quit

I suggest running /etc/cron.daily/find at this point, because you have a lot of new files on your system. Then you can use locate to get the location of any given file.

3.20.3 A Few Hints in Conclusion

When the install process runs dselect for you, you will doubtless be eager to get Debian running as soon as possible. Well, please be prepared to take an hour or so to learn your way around and then get it right. When you enter the Select screen for the first time, don’t make any selections at all—just press Enter and see what dependency problems there are. Try fixing them. If you find yourself back at the main screen, run Select again.

You can get an idea of the size of a package by pressing i twice and looking for the “Size” figure. This is the size of the compressed package, so the uncompressed files will be a lot bigger (see “Installed-Size,” which is in kilobytes, to know it).

Installing a new Debian system is a complex thing, but dselect can do it for you as easy as can be. So take the time to learn how to drive it. Read the help screens and experiment with i, I, o, and O. Use the R key. It’s all there, but it’s up to you to use it effectively.

3.21 Glossary

The following terms will be useful to you throughout this book and in general when you’re talking about Debian.

Package. A file that contains everything needed to install, de-install, and run a particular program. The program that handles packages is dpkg. dselect is a front-end to dpkg. Experienced users often use dpkg to install or remove a package.

Package names. All package names have the form xxxxxxxxxxx.deb. Sample package names include the following:

◼ efax08a-1.deb ◼ lrzsz0.12b-1.deb ◼ mgetty0.99.2-6.deb ◼ minicom1.75-1.deb ◼ term2.3.5-5.deb ◼ uucp1.06.1-2.deb ◼ uutraf1.1-1.deb ◼ xringd1.10-2.deb ◼ xtel_3.1-2.deb

4. Logging In

Your system is now installed! Pat yourself on the back for a job well done! Now it’s time to start using the system. In this chapter, we introduce you to the Debian command line, some security principles, and how to exit the system. In later chapters, we’ll go into more detail on these topics and introduce you to the Debian graphical interface, X11.

4.1 First Steps

After you quit dselect, you’ll be presented with the login: prompt. You can now log in using the personal login and password you selected; your system is now ready to use. Let’s examine what it means to log in and how this process works.

To use Debian, you must identify yourself to the system. This is so it knows who you are, what you have permission to do, and what your preferences are.

To this end, you have a username or login. If you installed Debian yourself, you should have been asked to give such a name during installation. If you are logging on to a system administered by someone else, you’ll have to ask him for an account on the system and a corresponding username.

You also have a password, so no one else can pretend to be you. If you don’t have a password, anyone can log on to your computer from the Internet and do bad things. If you’re worried about security, you should have a password.

Many people prefer to trust others not to do anything malicious with their account; hopefully your work environment doesn’t encourage paranoia. This is a perfectly reasonable attitude; it depends on your personal priorities and your environment. Obviously a home system does not need to be as secure as a military installation. Debian allows you to be as secure or as insecure as you like.

When you start Debian, you’ll see a prompt: a request from the computer for some information. In this case, the prompt is login:.

You should type your username and, when requested, your password. The password does not appear on the screen as you type it. Press Enter after both the username and the password. If you type your username or password incorrectly, you’ll have to start over.

If you do it correctly, you’ll see a brief message and then a $ prompt. The $ is printed by a special program called the shell and is thus called a shell prompt. This is where you give commands to the system.

Try entering the command whoami now. There is a cursor to the right of the shell prompt. Your cursor is a small underscore or rectangle that indicates where you’re typing; it should move as you type. Always press Enter when you’re done typing a shell command.

whoami tells your username. You’ll then get a new shell prompt.

For the rest of the book, when we say to enter a command, you should type it at the shell prompt and press the Enter key.

When you’re done working, you may want to log out of the system. To exit the shell, enter the exit command. Keep in mind that if you remain logged in, someone could come along and use your account. Hopefully you can trust those in your office or home not to do this; but if you do not trust your environment, you should be certain to log out when you leave.

4.2 Command History and Editing the Command Line

Whatever you type after the shell prompt and before pressing Enter is called a command line. It’s a line of text that commands the computer to do something. The Debian default shell offers several features to make entering command lines easy.

You can scroll up to previous commands to run them again, or you can modify them slightly and then run them again. Try this: Enter any command, such as whoami; then press the Up Arrow key. The whoami command will reappear at the prompt. You can then press Enter to run whoami a second time.

If you’ve entered several commands, you can keep pressing the Up Arrow key to go back through them. This feature is handy if you’re doing the same thing several times, or if you type a command incorrectly and want to go back to fix it. You can press the Down Arrow key to move in the other direction, toward your more recent commands. If there are no more commands to move to, the computer will beep.

You can also move around on the command line to make changes. The easiest way is with the Left and Right Arrow keys. Try typing whoasmi instead of whoami, and then use the Left Arrow key to move back to the s. You can erase the s with the Backspace or Delete keys.

There are more advanced features as well (no need to memorize them all now, though). Try pressing Ctrl-a. This moves you to the beginning of the line. Ctrl-k (the k stands for “kill”) deletes all characters until the end of the line; try it from the middle of the command line. Using Ctrl-a followed by Ctrl-k, you can delete the entire command line. Ctrl-y pastes the last thing you killed, reinserting it at the current cursor position (y stands for “yank,” as in “yank it back”). Ctrl-e will move the cursor to the end of the command line.

Go ahead and play around with command-line editing to get a feel for it. Experiment.

4.3 Working as Root

Because Debian is a multiuser system, it’s designed to keep any one user or program from breaking the entire system. The kernel will not allow normal users to change important system files. This means that things stay the way they’re supposed to, safe from accidents, viruses, and even malicious pranks. Unlike other operating systems, Debian is safe from these threats. You won’t need an anti-virus program.

However, sometimes you need to change important system files; for example, you might want to install new software or configure your network connection. To do so, you have to have greater powers than a normal user; you must become the root user (also called the superuser).

To become root, just log on with the username root and the root password; this was set during installation, as described in section 3.15 on page [*].

At many sites, only the system administrator has the root password, and only the system administrator can do the things that one must be root to do. If you’re using your own personal computer, you are the system administrator, of course. If you don’t have root privileges, you will have to rely on your system administrator to perform any tasks that require root privileges.

Sometimes you’ll have the root password even on a shared corporate or educational server, because the system administrator trusts you to use it properly. In that case, you’ll be able to help administer the system and customize it for your needs. But you should be sure to use the password responsibly, respecting other users at all times.

If you have the password, try logging on as root now. Enter the whoami command to verify your identity. Then log out immediately. When you’re root, the kernel will not protect you from yourself, because root has permission to do anything at all to the system. Don’t experiment while you’re root. In fact, don’t do anything as root unless absolutely necessary. This isn’t a matter of security, but rather of stability. Your system will run much better if it can keep you from making mistakes.

You may find the su command more convenient than logging in as root. su allows you to assume the identity of another user, usually root unless you specify someone else. (You can remember that su stands for Super User, though some say it stands for Set UserID.)

Here’s something to try. Log on as yourself—that is, not as root. Then your session will look something like the one in Figure 4.1.

When you’re doing system administration tasks, you should do as much as possible as yourself. Then use su, do the part that requires root privileges, and use the exit command to turn off privileges so you can no longer harm anything.

You can use su to assume the identity of any user on the system, not just root. To do this, type su user where user is the user you want to become. You’ll have to know the user’s password, of course, unless you’re root at the time or the user has no password.

4.4 Virtual Consoles

The Linux kernel supports virtual consoles. These provide a way of making your single screen and keyboard seem like multiple terminals that are connected to the same system. Thankfully, using virtual consoles is one of the simplest things about Debian: There are “hot keys” for switching among the consoles quickly. To try it, log in to your system and press Alt-F2 (simultaneously press the left Alt key, and F2, that is, function key number 2).

You should find yourself at another login prompt. Don’t panic: You are now on virtual console (VC) number 2! Log in here and do some things—more whoami commands or whatever—to confirm that this is a real login shell. Now you can return to virtual console number 1 by pressing Alt-F1. Or you can move on to a third virtual console, in the obvious way (Alt-F3).

Debian comes with six virtual consoles enabled by default, which you access with the Alt key and function keys F1 through F6. (Technically, there are more virtual consoles enabled, but only six of them allow you to log in. The others are used for the X Window system or other special purposes.)

If you’re using the X Window system, it will generally start up on the first unused virtual console—probably VC 7. Also, to switch from the X virtual console to one of the first six, you’ll have to add Ctrl to the key sequence. So that’s Ctrl-Alt-F1 to get to VC 1. But you can go from a text VC to the X virtual console using only Alt. If you never leave X, you won’t have to worry about this; X automatically switches you to its virtual console when it starts up.

Once you get used to them, virtual consoles will probably become an indispensable tool for getting many things done at once. (The X Window system serves much the same purpose, providing multiple windows rather than multiple consoles.) You can run a different program on each VC or log on as root on one VC and as yourself on another. Or everyone in the family can use his or her own VC; this is especially handy if you use X, in which case you can run several X sessions at once on different virtual consoles.

4.5 Shutting Down

Do not just turn off the computer! You risk losing valuable data!

If you are the only user of your computer, you might want to turn the computer off when you’re done with it.

To avoid possibly weakening some hardware components, only turn off the computer when you’re done for the day. Power up and power down are the two greatest contributors to wear and tear on computer components. Turning the computer on and off once a day is probably the best compromise between your electric bill and your computer’s lifespan.

It’s a bad thing to just press the power switch when you’re done using the computer. It is also bad to reboot the machine (with the Reset button) without first taking proper precautions. The Linux kernel, in order to improve performance, has a disk cache. This means it temporarily stores information meant for permanent storage in RAM. Because memory is thousands of times faster than a disk, this makes many file operations move more quickly. Periodically, the information Linux has in memory is actually written to the disk. This is called syncing. In order to turn off or reboot the computer safely, you’ll have to tell the computer to clear everything out of memory and put it in permanent storage.

To reboot, just type reboot or press Ctrl-Alt-Del (that’s Ctrl, Alt, and Delete).

To shut down, you’ll have to log in as root. As root, just type the command shutdown -h now. The sytem will go through the entire shutdown procedure, including the sync command, which clears the disk cache as described above. When you see System halted, it’s safe to turn off the computer. If you have Advanced Power Management (APM) support in your kernel and BIOS, the computer might shut itself off and save you the trouble. APM is common in laptops and is also found in certain desktop mainboards.

5. The Basics

It’s now time to explore the system in more detail. You’ve seen how to log in and shut down the system. In this chapter, we explore the Linux comand line, how Linux deals with files and directories, and some basics on identifying yourself to others.

5.1 The Command Line and Man Pages

We’ve already discussed the command line—that is, commands you type after the shell prompt. This section describes the structure of more complicated command lines.

A minimal command line contains just a command name, such as whoami. But other things are possible. For example, you might type: man whoami. This command requests the online manual for the whoami program (you may have to press the space bar to scroll through the documentation or press q to quit). A more complicated example is man -k PostScript. This command line has three parts. It begins with the command name, man. Then it has an option or switch, -k, followed by an argument, PostScript. Some people refer to everything except the command name as the parameters of the command. So, options and arguments are both parameters.

Options change the behavior of a command, switching on particular features or functionality. They usually have a - before them. The GNU utilities also have “long forms” for the options; the long form of -k is -apropos. You can enter man -h or man -help to get a full list of options for the man command. Every command will have its own set of options, though most have -help and -version options. Some commands, such as tar, do not require the “-” before their options for historical reasons.

Anything that isn’t an option and isn’t the command name is an argument (in this case, PostScript). Arguments can serve many purposes; most commonly, they are filenames that the command should operate on. In this case, PostScript is the word you want man to search for. In the case of man whoami, the argument was the command you wanted information about.

Here’s a breakdown of the man -k PostScript command line:

man. The command name, tells the computer to look at the manual pages. These provide documentation for commands. For example, man whoami will give you documentation on the whoami command.

-k. The option, changes the behavior of man. Normally man expects a command name, such as whoami, for an argument and looks for documentation of that command. But with the -k or -apropos option, it expects the argument to be a keyword. It then gives a list of all manual pages with that keyword in their description.

PostScript. is the argument; because we used the -k option, it’s the keyword to search for.

-k and PostScript are both parameters.

Go ahead and type man -k PostScript, and you will see a list of all the manual pages on your system that have something to do with PostScript. If you haven’t installed much software, you might see the message PostScript: nothing appropriate instead.

5.1.1 Describing the Command Line

Note: You can skip this section if you want to move on.

There’s a traditional, concise way of describing command syntax. Syntax means the correct ways to combine various options and arguments. For example, if you type man man to get the manual page about man, you’ll see several syntax descriptions beginning with the command name man. One of them will look like this: man -k [-M path] keyword ...

Anything in brackets ([]) is an optional unit. In this case you don’t have to use the -M option, but if you do, you must use a path argument. You must use the -k option and the keyword argument. The ... means that you could have more of whatever came before it, so you could look up several keywords.

Let’s look at one of the more complex descriptions from the man manual page:

man [-c|-w|-tZT device] [-adhu7V] [-m system[,...]] [-L locale] [-p string] [-M path] [-P pager] [-r prompt] [-S list] [-e extension] [[section] page ...] ...

There’s no need to go through all of this (and don’t worry about what it all means), but do pay attention to the organization of the description.

First, clusters of options usually mean you can use one or more of them in different combinations, so -adhu7V means you can also use -h. However, you can’t always use all combinations; this description doesn’t make that clear. For example, -h is incompatible with other options, but you could do man -du. Unfortunately, the description’s format does not make this clear.

Second, the | symbol means “or.” So you can use the -c, the -w, or the -tZT option, followed by a device argument.

Third, notice that you can nest the brackets, because they indicate optional units. So if you have a section, you must also have a page, because e page is not optional within the [[section] page] unit.

There’s no need to memorize any of this, just refer to this section as you read documentation.

5.2 Files and Directories

Files are a facility for storing and organizing information, analogous to paper documents. They’re organized into directories, which are called folders on some other systems. Let’s look at the organization of files on a Debian system:

/. A simple / represents the root directory. All other files and directories are contained in the root directory. If you are coming from the DOS/Windows world, / is very similar to what C:is for DOS, that is the root of the filesystem. A notable difference between DOS and Linux however, is that DOS keeps several filesystems: C: (first hard disk), A: (first floppy disk), and D: (either CD-ROM or second hard disk), whereas Linux has all its files organized above the same / root.

/home/janeq. This is the home directory of user “janeq.” Reading left to right, to get to this directory you start in the root directory, enter directory home, and then enter directory janeq.

/etc/X11/XF86Config. This is the configuration file for the X Window system. It resides in the X11 subdirectory of the /etc directory. /etc is in turn a subdirectory of the root directory, /.

Things to note:

◼ Filenames are case-sensitive. That is, MYFILE and MyFile are different files. ◼ The root directory is referred to as simply /. Don’t confuse this “root” with the root user, the user on your system with “super powers.” ◼ Every directory has a name, which can contain any letters or symbols except /. The root directory is an exception; its name is / (pronounced “slash” or “the root directory”), and it cannot be renamed. ◼ While you can use almost any letters or symbols in a filename, in practice it’s a bad idea. It is better to avoid characters that often have special meanings on the command line, including: { } ( ) [ ] ’ ‘ " \/ > < | ; ! # & ^ * % ◼ Also avoid putting spaces in filenames. If you want to separate words in a name, good choices are the period, hyphen, and underscore. You could also capitalize each word, LikeThis. ◼ Each file or directory is designated by a fully-qualified filename, absolute filename, or path, giving the sequence of directories which must be passed through to reach it. The three terms are synonymous. All absolute filenames begin with the / directory, and there’s a / before each directory or file in the filename. The first / is the name of a directory, but the others are simply separators to distinguish the parts of the filename. ◼ The words used here can be confusing. Take the following example: /usr/share/keytables/us.map.gz. This is a fully-qualified /filename; some people call it a path. However, people will also refer to us.map.gz alone as a filename. ◼ There is also another use for the word “path.” The intended meaning is usually clear from the context. ◼ Directories are arranged in a tree structure. All absolute filenames start with the root directory. The root directory has a number of branches, such as /etc and /usr. These subdirectories in turn branch into still more subdirectories, such as /etc/init.d and /usr/local. The whole thing together is called the “directory tree.” ◼ You can think of an absolute filename as a route from the base of the tree (/) to the end of some branch (a file). You’ll also hear people talk about the directory tree as if it were a family tree: Thus subdirectories have “parent,” and a path shows the complete ancestry of a file. ◼ There are also relative paths that begin somewhere other than the root directory. More on this later. ◼ No directory corresponds to a physical device, such as your hard disk. This differs from DOS and Windows, in which all paths begin with a device name such as C:\. The directory tree is meant to be an abstraction of the physical hardware, so you can use the system without knowing what the hardware is. All your files could be on one disk—or you could have 20 disks, some of them connected to a different computer elsewhere on the network. You can’t tell just by looking at the directory tree, and nearly all commands work just the same way no matter what physical device(s) your files are really on.

Don’t worry if all this isn’t completely clear yet. There are many examples to come.

5.2.1 Using Files: A Tutorial

To use your system, you’ll have to know how to create, move, rename, and delete files and directories. This section describes how to do so with the standard Debian commands.

The best way to learn is to try things. As long as you aren’t root (and haven’t yet created any important personal files), you cannot mess up too seriously. Jump in—type each of these commands at the prompt and press Enter.

pwd

One directory is always considered the current working directory for the shell you’re using. You can view this directory with the pwd command, which stands for Print Working Directory. pwd prints the name of the directory you’re working in—probably /home/yourname.

ls stands for “list,” as in “list files.” When you type ls, the system displays a list of all the files in your current working directory. If you’ve just installed Debian, your home directory may well be empty. If your working directory is empty, ls produces no output, because there are no files to list.

cd /

cd means “change directory.” In this case, you’ve asked to change to the root directory.

pwd

This verifies that you’re working in the root directory.

Lets you see what’s in /.

Typing cd with no arguments selects your home directory— /home/ yourname —as the current working directory. Try pwd to verify this.

Before continuing, you should know that there are actually two different kinds of filenames. Some of them begin with /, the root directory, such as /etc/profile. These are called absolute filenames because they /refer to the same file no matter what your current directory is. The other kind of filename is relative.

Two directory names are used only in relative filenames: . and ... The directory . refers to the current directory, and .. is the parent directory. These are “shortcut” directories. They exist in every directory. Even the root directory has a parent directory—it’s its own parent!

So filenames that include . or .. are relative, because their meaning depends on the current directory. If I’m in /usr/bin and type ../etc, I’m referring to /usr/etc. If I’m in /var and type ../etc, I’m referring to /etc. Note that a filename without the root directory at the front implicitly has ./ at the front. So you can type local/bin, or ./local/bin and it means the same thing.

A final handy tip: The tilde ~ is equivalent to your home directory. So typing cd ~ is the same as typing cd with no arguments. Also, you can type things like cd ~/practice/mysubdirectory to change to the directory /home/yourname/practice/mysubdirectory. In a similar way, ~myuser is equivalent to the home directory of the user “myuser,” which is probably something like /home/myuser; so ~myuser/docs/debian.ps is equivalent to /home/myuser/doc/debian.ps. / / / Here are some more file commands to try out, now that you know about relative filenames. cd to your home directory before you begin.

mkdir practice

In your home directory, make a directory called practice. You’ll use this directory to try out some other commands. You might type ls to verify that your new directory exists.

cd practice

Changes the directory to practice.

mkdir mysubdirectory

Creates a subdirectory of practice.

cp /etc/profile .

cp is short for “copy.” /etc/profile is just a random file on your system, don’t worry about what it is for now. We’ve copied it to . (recall that . just means “the directory I’m in now,” or the current working directory). So this creates a copy of /etc/profile and puts it in your practice directory. Try typing ls to verify that there’s indeed a file called profile in your working directory, alongside the new mysubdirectory.

more profile

This lets you view the contents of the file profile. more is used to view the contents of text files. It’s called more because it shows one screenful of the file at a time, and you press the space bar to see more. more will exit when you get to the end of the file, or when you press q (quit).

more /etc/profile

Verifies that the original looks just like the copy you made.

mv profile mysubdirectory

mv stands for “move.” You’ve moved the file profile from the current directory into the subdirectory you created earlier.

Verifies that profile is no longer in the current directory.

ls mysubdirectory

Verifies that profile has moved to mysubdirectory.

cd mysubdirectory

Changes to the subdirectory.

mv profile myprofile

Note that unlike some operating systems, there is no difference between moving a file and renaming it. Thus there’s no separate rename command. Note that the second argument to mv can be a directory to move the file or directory into, or it can be a new filename. cp works the same way.

As usual, you can type ls to see the result of mv.

mv myprofile ..

Just as . means “the directory I’m in now,” .. means “parent of the current directory,” in this case the practice directory you created earlier. Use ls to verify that that’s where myprofile is now.

cd ..

Changes directories to the parent directory—in this case practice, where you just put myprofile.

rm myprofile

rm means “remove,” so this deletes myprofile. Be careful! Deleting a file on a GNU/Linux system is permanent—there is no undelete. If you rm it, it’s gone, forever. Be careful! To repeat, deleting a file on a GNU/Linux system is permanent—there is no undelete. If you rm it, it’s gone, forever.

rmdir mysubdirectory

rmdir is just like rm, only it’s for directories. Notice that rmdir only works on empty directories. If the directory contains files, you must delete those files first, or alternatively you can use rm -r in place of rmdir.

cd ..

This moves out of the current directory, and into its parent directory. Now you can type the following:

rmdir practice

This will delete the last remnants of your practice session.

So now you know how to create, copy, move, rename, and delete files and directories. You also learned some shortcuts, like typing simply cd to jump to your home directory, and how . and .. refer to the current directory and its parent, respectively. You should also remember the concept of the root directory, or /, and the alias ~ for your home directory.

5.2.2 Dot Files and ls -a

When you type ls, files beginning with a dot are not listed. Traditionally, files that contain configuration information, user preferences, and so on begin with a dot; these are hidden and out of your way while you do your day-to-day work. Sample dot files are ~/.emacs, ~/.newsrc, ~/.bashrc, ~/.xsession, and ~/.fvwmrc. These are used by Emacs, news readers, the Bash shell, the X Window system, and the fvwm window manager, respectively. It is conventional to end the dot filename with rc, but some programs don’t. There are also directories beginning with a dot, such as ~/.gimp and ~/.netscape, which store preferences for the Gimp and Netscape.

Sometimes a program will create a dot file automatically; for example, Netscape allows you to edit your preferences with a graphical dialog box and then it saves your choices. Other times you will create them yourself using a text editor; this is the traditional way to do it, but you have to learn the peculiar format of each file—inconvenient at first, but it can give you a lot of power.

To see dot files, you must use the -a option to ls. The long form of -a is -all, if you find that easier to remember. You can also use -A or -almost-all, which displays all dot files except . and ... Remember that . is the current directory, and .. is the parent of the current directory; because these are guaranteed to be in every directory, there is no real reason to list them with ls. You already know they are there.

5.3 Processes

We mentioned before that GNU/Linux is a multitasking system. It can do many tasks at once. Each of these tasks is called a process. The best way to get a sense of this is to type top at the shell prompt. You’ll get a list of processes, sorted according to how much of the computer’s processing time they’re using. The order will continuously change before your eyes. At the top of the display, there’s some information about the system: how many users are logged in, how many total processes there are, how much memory you have and how much you’re using.

In the far left column, you’ll see the user owning each process. The far right column shows which command invoked the process. You’ll probably notice that top itself, invoked by you, is near the top of the list (because anytime top checks on CPU usage, it will be active and using CPU to do the check).

Note that in all the commands ending in “d” —such as kflushd and inetd —the “d” stands for daemon.

Daemon originally meant Disks And Extensions MONitor. A daemon is a non-interactive process, that is, it’s run by the system and users never have to worry about it. Daemons provide services like Internet connectivity, printing, or e-mail.

Now press u and give top your username when it asks. The u command asks to see only those processes belonging to you; it allows you to ignore all the daemons and whatever other people are doing. You might notice bash, the name of your shell. You’ll pretty much always be running bash.

Note that column two of the top display shows you the PID, or Process IDentification number. Each process is assigned a unique PID. You can use the PID to control individual processes (more on that later). Another useful trick is to press ? to get a list of top commands.

You may wonder about the difference between a “process” and a “program.” In practice, people use the terms interchangeably. Technically, the program is the set of instructions written by a programmer and kept on disk. The process is the working instantiation of the program kept in memory by Linux. But it’s not that important to keep the terms straight.

Much of your interaction with a computer involves controlling processes. You’ll want to start them, stop them, and see what they’re up to. Your primary tool for this is the shell.

5.4 The Shell

The shell is a program that allows you to interact with your computer. It’s called a shell because it provides an environment for you to work in—sort of a little electronic home for you as you compute. (Think hermit crab.)

The simplest function of the shell is to launch other programs. You type the name of the program you want to run, followed by the arguments you want, and the shell asks the system to run the program for you.

Of course, graphical windowing systems also fill this need. Technically, Windows 95 provides a graphical shell, and the X Window system is another kind of graphical shell. But “shell” is commonly used to mean “command-line shell.”

Needless to say, the hackers who work on shells aren’t satisfied with simply launching commands. Your shell has a bewildering number of convenient and powerful features if you would like to take advantage of them.

There are countless different shells available; most are based on either the Bourne shell or the C shell, two of the oldest shells. The original Bourne shell’s program name is sh, while csh is the C shell. Bourne shell variants include the Bourne Again Shell from the GNU project (bash, the Debian default), the Korn shell (ksh), and the Z shell (zsh). There is also ash, a traditional implementation of the Bourne shell. The most common C shell variant is tcsh (the t pays tribute to the TENEX and TOPS-20 operating systems, which inspired some of tcsh’s improvements over csh).

bash is probably the best choice for new users. It is the default and has all the features you’re likely to need. But all the shells have loyal followings; if you want to experiment, install some different shell packages and change your shell with the chsh command. Just type chsh, supply a password when asked, and choose a shell. When you next log in, you’ll be using the new shell.

5.5 Managing Processes with bash

Debian is a multitasking system, so you need a way to do more than one thing at once. Graphical environments like X provide a natural way to do this; they allow multiple windows on the screen at any one time. Naturally, bash (or any other shell) provides similar facilities.

Earlier you used top to look at the different processes on the system. Your shell provides some convenient ways to keep track of only those processes you’ve started from the command line. Each command line starts a job (also called a process group) to be carried out by the shell. A job can consist of a single process or a set of processes in a pipeline (more on pipelines later).

Entering a command line will start a job. Try typing man cp, and the cp manual page will appear on the screen. The shell will go into the background and return when you finish reading the manual page (or you can press q to quit rather than scrolling through the whole thing).

But say you’re reading the manual page, and you want to do something else for a minute. No problem. Press Ctrl-z while you’re reading to suspend the current foreground job and put the shell in the foreground. When you suspend a job, bash will first give you some information on it, followed by a shell prompt. You will see something like this on the screen:

NAME cp - copy files SYNOPSIS cp [options] source --More-- + Stopped man cp $

Note the last two lines. The next to last is the job information, and then you have a shell prompt.

bash assigns a job number to each command line you run from the shell. This allows you to refer to the process easily. In this case, man cp is job number 1, displayed as . The + means that this is the last job you had in the foreground. bash also tells you the current state of the job—Stopped—and the job’s command line.

There are many things you can do with jobs. With man cp still suspended, try the following commands:

man ls

Starts a new job.

Ctrl-z

Suspends the man ls job; you should see its job information.

man mv

Starts yet another job.

Ctrl-z

Suspends it.

jobs

Asks bash for a display of current jobs. The result looks like this:

{$} jobs Stopped man cp - Stopped man ls + Stopped man mv {$}

Notice the - and +, denoting respectively the next to last and last foreground jobs.

Places the last foreground job (man mv, the one with the +) in the foreground again. If you press the space bar, the man page will continue scrolling.

Ctrl-z

Re-suspends man mv.

fg %1

You can refer to any job by placing a % in front of its number. If you use fg without specifying a job, the last active one is assumed.

Ctrl-z

Re-suspends man cp.

kill %1

Kills off job 1. bash will report the job information, which will look like this:

$ kill %1 - Terminated man cp $

bash is only asking the job to quit, and sometimes a job will not want to do so. If the job doesn’t terminate, you can add the -KILL option to kill to stop asking and start demanding. For example:

Many people use the signal number -9 instead of the signal name -KILL. However, it’s technically more portable to use the signal name.

$ kill -KILL %1 - Killed man mv $

The -KILL option forcibly and unconditionally kills off the job.

In technical terms, kill simply sends a signal. By default, it sends a signal that requests termination (TERM, or signal 15) but you can also specify a signal, and signal 9 (KILL) is the signal that forces termination. The command name kill is not necessarily appropriate to the signal sent; for example, sending the TSTP (terminal stop) signal suspends the process but allows it to be continued later.

top

This brings the top display back up. Give the u command in top to see only your processes. Look in the right-hand column for the man ls and man mv commands. man cp won’t be there because you killed it. top is showing you the system processes corresponding to your jobs; notice that the PID on the left of the screen does not correspond to the job number.

You may not be able to find your processes because they’re off the bottom of the screen; if you’re using X (see Chapter 9 on page [*]), you can resize the xterm to solve this problem.

Even these simple jobs actually consist of multiple processes, including the man process and the pager more, which handles scrolling one page at a time. You may notice the more processes are also visible in top.

You can probably figure out how to clean up the remaining two jobs. You can either kill them (with the kill command) or foreground each one (with fg) and exit it. Remember that the jobs command gives you a list of existing jobs and their status.

One final note: The documentation for bash is quite good, but it is found in the Info help system rather than the man pages. To read it, type info bash. See section A.1.1 for instructions on using the info program. bash also contains a very good summary of its commands accessible by the help command. help displays a list of available topics; more information about each of them is accessible with the command help topic name. Try typing help cd, for example. This will give you details on the -P and -L arguments recognized by cd.

5.6 A Few bash Features

This section mentions just a few of the most commonly used Bash features; for a more complete discussion see Chapter 6.

5.6.1 Tab Completion

The bash shell can guess what filename or command you are trying to type and automatically finish typing it for you. Just type the beginning of a command or filename and press Tab. If bash finds a single unique completion, it will finish the word and put a space after it. If it finds multiple possible completions, it will fill out the part all completions have in common and beep. You can then enter enough of the word to make it unique and press Tab again. If it finds no completions, it will simply beep.

5.7 Managing Your Identity

Unix-like systems are multiuser, and so you have your own electronic identity as a user on the system. Type finger yourusername to look at some of the information about you that’s publically available. To change the name and shell listed there, you can use the commands chfn and chsh. Only the superuser can change your login (username) and directory. You’ll notice that it says “No plan.” A “plan” is just some information you can make available to others. To create a plan, you put whatever information you want people to see in a file called .plan. To do this you’ll use a text editor; see section 8.2 on page [*]. Then finger yourself to see your plan. Others can finger you to see your plan and to check whether you’ve received new mail or read your mail.

Note that this finger information is available to the entire Internet by default. If you don’t want this, read about configuring inetd and the file /etc/services. Eventually the installation manual will describe this configuration, but for now you might try the man pages or just put nonsense in for your finger information.

6. Using the Shell

As you have been reading this book, you’ve been interacting with the shell already. The shell is the program that reads your commands and then does what you ask it to. In this chapter, you explore the shell in greater detail, with a special eye towards customizing the shell to work as you want it to.

6.1 Environment Variables

Every process has an environment associated with it. An environment is a collection of environment variables. A variable is a changeable value with a fixed name. For example, the name EMAIL could refer to the value joe@nowhere.com. The value can vary; EMAIL could also refer to jane@somewhere.com.

Because your shell is a process like any other, it has an environment. You can view your shell’s environment by entering the printenv command. Figure 6.1 has some sample output from printenv. On your system, the output will be different but similar.

Environment variables are one way to configure the system. For example, the EDITOR variable lets you select your preferred editor for posting news, writing e-mail, and so on.

Setting environment variables is simple. For practice, try customizing your shell’s prompt and your text file viewer with environment variables. First, let’s get a bit of background information.

man less

This command lets you view the online manual for the less command. In order to show you the text one screenful at a time, man invokes a pager that shows you a new page of text each time you press the space bar. By default, it uses the pager called more.

Go ahead and glance over the man page for less, which is an enhanced pager. Scroll to a new page by pressing space; press q to quit. more will also quit automatically when you reach the end of the man page.

export PAGER=less

After reading about the advantages of less, you might want to use it to read man pages. To do this, you set the environment variable PAGER.

The command to set an environment variable within bash always has this format:

Illustration: Figure 6.2: Changing the prompt

export NAME=value

export means to move the variable from the shell into the environment. This means that programs other than the shell (for instance, a file viewer) will be able to access it.

echo $PAGER

This is the easiest way to see the value of a variable. $PAGER tells the shell to insert the value of the PAGER variable before invoking the command. echo echoes back its argument: in this case, it echoes the current PAGER value, less.

man more

Displays the more manual. This time, man should have invoked the less pager.

less has lots of features that more lacks. For example, you can scroll backward with the b key. You can also move up and down (even sideways) with the arrow keys. less won’t exit when it reaches the end of the man page; it will wait for you to press q.

You can try out some less-specific commands, like b, to verify that they don’t work with more and that you are indeed using more.

unset PAGER

If you don’t want to specify a pager anymore, you can unset the variable. man will then use more by default, just as it did before you set the variable.

echo $PAGER

Because PAGER has been unset, echo won’t print anything.

PS1=hello:

Just for fun, change your shell prompt. $ should now change; see Figure 6.2 for details.

export is not necessary, because you’re changing the shell’s own behavior. There’s no reason to export the variable into the environment for other programs to see. Technically, PS1 is a shell variable rather than an environment variable.

If you wanted to, you could export the shell variable, transforming it into an environment variable. If you do this, programs you run from the shell can see it.

6.2 Where Commands Reside: The PATH Variable

When you type a command into the shell, it has to find the program on your hard disk before executing it. If the shell had to look all over the disk, it would be very slow; instead, it looks in a list of directories contained in the PATH environment variable. This list of directories makes up the shell’s search path; when you enter a command, it goes through each one in turn looking for the program you asked to run.

You may need to change the PATH variable if you install programs yourself in a non-standard location. The value of PATH is a colon-separated list of directories. The default value on Debian systems is as follows:

/usr/local/bin:/usr/bin:/bin:/usr/bin/X11:/usr/games / / / / This value is defined in the file /etc/profile and applies to all users. You can easily change the value, just as you can change any environment variable. If you type the command ls, the shell will first look in /usr/local/bin; ls isn’t there, so it will try /usr/bin; when that /fails, it will check /bin. There it will discover /bin/ls, stop its search, and execute the program /bin/ls. If /usr/bin/X11/ls existed (it doesn’t, but pretend), it would be ignored.

You can see which ls the shell is going to use with the type command. type ls will give you the answer /bin/ls. Try it yourself.

Try asking where type itself resides:

$ type type type is a shell builtin

type isn’t actually a program; it’s a function provided by the shell. However, you use it just like an external program.

There are a number of commands like this; type man builtins to read the man page describing them. In general, you don’t need to know whether a command is a builtin or a real program; however, builtins will not show up in the output of ps or top because they aren’t separate processes. They’re just part of the shell.

6.3 Configuration Files

Many applications on Linux systems allow you to alter how they behave at certain times by altering files containing configuration information. These configuration files may contain application start-up information, run-time settings and application shutdown settings. In general, a configuration filename is based on the name of the application for which it contains settings. Such a naming convention allows you to more readily determine which configuration file contains settings for a given application.

6.3.1 System-Wide Versus User-Specific Configuration

It’s important to remember that there are two different kinds of configurations on a Debian system. System-wide configuration affects all users. System-wide settings are made in the /etc directory, so you generally must be root in order to change system-wide settings. You might configure the way the system connects to the Internet, for example, or have web browsers on the system always start on the company home page. Since you want these settings to apply to all users, you make the changes in /etc. Sample configuration files in /etc include /etc/X11/XF86Config, /etc/lynx.cfg, and /etc/ppp/options. In fact, nearly all the files /in /etc are configuration files.

User configuration affects only a single user. Dotfiles are used for user configuration. For example, the file ~/.newsrc stores a list of which USENET (discussion group) articles you have read and which groups you subscribe to. This allows news readers such as trn or GNUS to display unread articles in the groups you’re interested in. This information will be different for every user on the system, so each user has his own .newsrc file in his home directory.

6.4 Aliases

If you use the same command often, you might get tired of typing it. bash lets you write shorter aliases for your commands.

Say you always use the -almost-all and -color=auto options to ls. You quickly get tired of typing ls -almost-all -color=auto. So you make an alias:

alias myls=’ls -almost-all -color=auto’

Now you can type myls instead of the full command. To see what myls really is, run the command type myls. To see a list of aliases you’ve defined, simply type alias on a line by itself.

6.5 Controlling Input and Output

Throughout your experiences with Linux, you will most likely find that manipulating application input and output can be a very powerful thing to do. This section describes some of the things that controlling input and output can do for you.

6.5.1 stdin, stdout, Pipelines, and Redirection

Every process has at least three connections to the outside world. The standard input is one source of the process’s data; the standard output is one place the process sends data; and the standard error is a place the process can send error messages. (These are often abbreviated stdin, stdout, and stderr.)

The words “source” and “place” are intentionally vague. These standard input and output locations can be changed by the user; they could be the screen, the keyboard, a file, even a network connection. You can specify which locations to use.

When you run a program from the shell, usually standard input comes from your keyboard, and standard output and error both go to your screen. However, you can ask the shell to change these defaults.

For example, the echo command sends it output to standard output, normally the screen. But you can send it to a file instead with the output redirection operator, >. For example, to put the word “Hello” in the file myfile, use this command:

echo Hello > myfile

Use cat or your text file pager (more or less) to view myfile’s contents; see Figure 6.3.

You can change the standard input of a command with the input redirection operator, <. For example, cat < myfile will display the contents of myfile. This is not useful in practice; for convenience, the cat command accepts a filename argument. So you can simply say cat myfile, and the effect will be the same. redirection operators

Under the hood, cat < myfile means that the shell opens myfile and then feeds its contents to the standard input of cat. cat myfile, without the redirection operator, means that the cat command receives one argument (myfile) opens the file itself, and then displays the file.

There’s a reason for the double functionality, however. For example, you can connect the standard output of one command to the standard input of another. This is called a pipeline, and it uses the pipe operator, |.

Depending on your keyboard, this may either appear as a vertical bar or a broken vertical bar, but it can almost always be found above the backslash (\).

Perhaps you want to see the GNU General Public License in reverse. To do this, you use the tac command (it’s cat, only backward). Try it out:

tac /usr/doc/copyright/GPL

Unfortunately, it goes by too quickly to read. So you only get to see a couple of paragraphs. The solution is a pipeline:

tac /usr/doc/copyright/GPL | less

This takes the standard output of tac, which is the GPL in reverse, and sends it to the standard input of less.

You can chain as many commands together as you like. Say you have an inexplicable desire to replace every G with Q. For this you use the command tr G Q, like this:

tac /usr/doc/copyright/GPL | tr G Q | less

You could get the same effect using temporary files and redirection, for example:

tac /usr/doc/copyright/GPL > tmpfile tr G Q < tmpfile > tmpfile2 less < tmpfile2 rm tmpfile tmpfile2

Clearly a pipeline is more convenient.

6.6 Filename Expansion

Often you want a command to work with a group of files. Wildcards are used to create a filename expansion pattern: a series of characters and wildcards that expands to a list of filenames. For example, the pattern /etc/* expands to a list of all the files in /etc.

Actually, files beginning with . are not included in the expansion of *.

* is a wildcard that can stand for any series of characters, so the pattern /etc/* will expand to a list of all the filenames beginning with /etc/. / / / This filename list is most useful as a set of arguments for a command. For example, the /etc directory contains a series of subdirectories called rc0.d, rc1.d, etc. Normally to view the contents of these, you would type the following:

ls /etc/rc0.d /etc/rc1.d /etc/rc2.d /etc/rc3.d ls /etc/rc4.d /etc/rc5.d /etc/rc6.d /etc/rcS.d

This is tedious. Instead, you can use the ? wildcard as shown here:

ls /etc/rc?.d

/etc/rc?.d expands to a list of filenames that begin with rc, /followed by any single character, followed by .d.

Available wildcards include the following:

* Matches any group of 0 or more characters.

? Matches exactly one character.

Expansion patterns are simple once you see some concrete examples:

*.txt This will give you a list of all filenames that end in .txt, since the * matches anything at all.

*. This gives a list of filenames that end in either .h or .c.

a?? This gives you all three-letter filenames that begin with a.

a* This gives you every filename that starts with a, regardless of how many letters it has.

7. More on Files

In section 5.2 on page [*], we covered moving and renaming files with mv, copying them with cp, removing them with rm, removing directories with rmdir, and creating directories with mkdir. This chapter will cover some more aspects of working with files.

Permissions

GNU and Unix systems are set up to allow many people to use the same computer, while keeping certain files private or keeping certain people from modifying certain files. You can verify this for yourself. Log in as yourself, i.e. NOT as root.

whoami

This verifies that you are not root. Then enter the following command:

rm /etc/resolv.conf

You should be told Permission denied. /etc/resolv.conf is an essential system configuration file; you aren’t allowed to change or remove it unless you’re root. This keeps you from accidentally messing up the system, and if the computer is a public one (such as at an office or school), it keeps users from messing up the system on purpose.

Now type ls -l /etc/resolv.conf.

This will give you output that looks something like this:

-rw-r-r- 1 root root 119 Feb 23 1997 /etc/resolv.conf

The -l option to ls requests all that additional information. The info on the right is easy: The size of the file is 119 bytes; the date the file was last changed is February 23, 1997; and the file’s name is /etc/resolv.conf. On the left side of the screen, things are a /little more complicated.

First, the brief, technical explanation: The -rw-r-r- is the mode of the file, the 1 is the number of hard links to this file (or the number of files in a directory), and the two roots are the user and group owning the file, respectively.

So that was cryptic. Let’s go through it slowly.

7.1.1 File Ownership

Every file has two owners: a user and a group. The above case is a little confusing because there’s a group called root in addition to the root user. Groups are just collections of users who are collectively permitted access to some part of the system. A good example is a games group. Just to be mean, you might create a group called games on your computer and then set up your system so that only people in a games group are allowed to play games.

Here’s a more practical example. Consider a case in which you’re setting up a computer for a school. You might want certain files to be accessible only to teachers, not students, so you put all the teachers in a single group. Then you can tell the system that certain files belong to members of the group teachers, and that no one else can access those files.

Let’s explore groups on the system. First, you can use the groups command at the shell prompt. This will show you a list of the groups to which you belong. Here’s an example:

$ groups system-wide configuration!permissions!file ownershipusername dialout cdrom floppy audio

It’s likely that you’re a member of only one group, which is identical to your username. However, root can add you to other groups. The above example shows a person that is a member of five groups.

less /etc/group

This file lists the groups that exist on your system. Notice the root group (the only member of this group is the root user), and the group that corresponds to your username. There are also groups like dialout (users who are allowed to dial out on the modem) and floppy (users who can use the floppy drive). However, your system is probably not configured to make use of these groups. It’s likely that only root can use the floppy or the modem right now. For details about this file, try reading man group.

ls -l /home

This command shows you that every user’s directory is owned by that user and that user’s personal group.

Tip: If you just installed Debian, you may be the only user. You can use the adduser command to add more users to the system.

7.1.2 Mode

In addition to being owned by one user and one group, every file and directory also has a mode, which determines who’s allowed to read, write, and execute the file (and run it, if it’s a program). There are a few other things also determined by the mode, but they’re advanced topics so we’ll skip them for now.

The mode looks like this in the ls output: -rw-r-r-. For now, we’ll consider nine of these parts: those that control read, write, and execute permissions for the user owning the file, the group owning the file, and others (everyone on the system, sometimes called world).

In the mode line, the first “element” gives the file type. The - in this case means it’s a regular file. If it was d, we’d be looking at a directory. There are also other possibilities too complex to go into here; for details, see section 13.2.2 on page [*].

The remaining nine elements are used to display the file’s mode. The basic 9 bits (read, write, and execute for user, group, and other) are displayed as three blocks of rwx.

So if all permissions are turned on and this is a regular file, the mode will look like this: -rwxrwxrwx. If it was a directory with all permissions turned off for others and full permissions for user and group, it would be drwxrwx--.

Table 7.1: Permissions in Linux +------------------------------------------------------------------------------+ | Code | Name | Allows for Files | Allows for Directories | |------+---------+--------------------------+----------------------------------| | r | read | Examine contents of file | List contents of directory | |------+---------+--------------------------+----------------------------------| | w | write | Modify file | Add or remove files in directory | |------+---------+--------------------------+----------------------------------| | x | execute | Run as a command | Access files in directory | +------------------------------------------------------------------------------+

Table 7.1 describes the meaning of the read, write, and execute permissions for both files and directories.

Directory modes can be a little confusing, so here are some examples of the effects of various combinations:

The user, group, or other with these permissions may list the contents of the directory, but can do nothing else. The files in the directory can’t be read, changed, deleted, or manipulated in any way. The only permitted action is reading the directory itself, that is, seeing what files it contains.

rw-

Write permission has no effect in the absence of execute permission, so this mode behaves just like the above mode.

r-x

This mode permits the files in a directory to be listed and permits access to those files. However, files can’t be created or deleted. Access means that you can view, change, or execute the files as permitted by the files’ own permissions.

Files in this directory can be accessed, but the contents of the directory can’t be listed, so you have to know what filename you’re looking for in advance (unless you’re exceptionally good at guessing). Files can’t be created or deleted.

rwx

You can do anything you want with the files in this directory, as long as it’s permitted by the permissions on the files themselves.

Directory write permission determines whether you can delete files in a directory. A read-only file can be deleted if you have permission to write to the directory containing it. You can’t delete a file from a read-only directory even if you’re allowed to make changes to the file.

This also means that if you own a directory you can always delete files from it, even if those files belong to root.

Directory execute permission determines whether you have access to files - and thus whether file permissions come into play. If you have execute permissions to a directory, file permissions for that directory become relevant. Otherwise, file permissions just don’t matter; you can’t access the files anyway.

7.1.3 Permissions in Practice

This section goes through a short example session to demonstrate how permissions are used. To change permissions, we’ll use the chmod command.

cd; touch myfile

There are a couple of new tricks here. First, you can use ; to put two commands on one line. You can type the above as:

$ cd $ touch myfile

or as:

$ cd; touch myfile

Either way the same thing will end up happening.

Recall that cd by itself returns you to your home directory. touch is normally used to change the modification time of the file to the current time. But it has another interesting feature: If the file doesn’t exist, touch creates the file. So you’re using it to create a file to practice with. Use ls -l to confirm that the file has been created and notice the permissions mode:

$ ls -l

-rw-r-r- 1 user user 0 Nov 18 22:04 myfile

Obviously the time and user/group names will be different when you try it. The size of the file is 0, because touch creates an empty file. -rw-r-r- is the default permissions mode on Debian.

chmod u+x myfile

This command means to add (+) execute (x) permissions for the user (u) who owns the file. Use ls -l to see the effects.

chmod go-r myfile

Here you’ve subtracted (-) read permission (r) from the group (g) owning the file and from everyone else (others, o). Again, use ls -l to verify the effects.

chmod ugo=rx myfile

Here you’ve set (=) user, group, and other permissions to read and execute. This sets permissions to exactly what you’ve specified and unsets any other permissions. So all rx should be set, and all w should be unset. Now, no one can write to the file.

chmod a-x myfile

a is a shortcut for ugo, or “all.” So all the x permissions should now be unset.

rm myfile

With this command, you’re removing the file, but without write permissions. rm will ask if you’re sure by displaying the following message:

rm: remove ‘myfile’, overriding mode 0444?

You should respond by typing y and pressing Enter. This is a feature of rm, not a fact of permissions. Permission to delete a file comes from the directory permissions, and you have write permission in the directory. However, rm tries to be helpful, figuring that if you didn’t want to change the file (and thus remove write permission), you don’t want to delete it either, so it asks you.

What was that 0444 business in the question from rm? The permissions mode is a twelve-digit binary number, like this: 000100100100. 0444 is this binary number represented as an octal (base 8) number, which is the conventional way to write a mode. So you can type chmod 444 myfile instead of chmod ugo=r myfile.

7.2 Files Present and Their Locations

Now that you can navigate the directory tree, let’s take a guided tour of the files and directories you created when you installed Debian. If you’re curious, cd to each directory and type ls to see its contents. If the listing doesn’t fit on the screen, try ls | less, where | is the “pipe” character, generally found on the same key with backslash.

/ As already mentioned, this is the root directory, which contains / every other directory.

/root But don’t get /confused with /root! /root is the home directory of the root user, or superuser. It’s a directory called /root, but it isn’t the root directory /.

/home This is where all normal users—that is, all users except root—have their home directories. Each home directory is named after the user who owns it, for example, /home/jane. If you’re using a large system at a school or business, your system administrator may create additional directories to contain home directories: /home1 and /home2 for example. On some other systems, you’ll see an additional level of subdirectories: /home/students/username, /home/staff/username, etc.

Your home directory is where you put all your personal work, e-mail and other documents, and personal configuration preferences. It’s your home on the system.

/bin This directory contains “binaries,” executable files that are essential to the operation of the system. Examples are the shell (bash) and file commands such as cp.

/sbin This directory contains “system binaries,” utilities that the root user or system administrator might want to use, but that you probably won’t want to use in your day-to-day activities.

/usr /usr contains most of the files you’ll be interested in. It /has many subdirectories. /usr/bin and /usr/sbin are pretty much like /bin and /sbin, except that the directories in /usr are not considered “essential to the operation of the system.”

While not essential to getting the computer working, /usr does contain the applications you’ll use to get real work done. Also in /usr, you’ll find the /usr/man, /usr/info, and /usr/doc directories. These contain manual pages, info pages, and other documentation, respectively. And don’t forget /usr/games!

/usr/local The Debian system doesn’t install anything in this directory. You should use it if you want to install software that you compile yourself or any software not contained in a Debian package. You can also install software in your home directory if you’ll be the only one using it.

/etc /etc contains all the system-wide configuration files. /Whenever you want to change something that affects all users of your computer—such as how you connect to the Internet or what kind of video card you have—you’ll probably have to log on as root and change a file in /etc.

/tmp Here you’ll find temporary files, most of them created by the system. This directory is generally erased on a regular basis or every time you reboot the system. You can create files here if you want, just be aware that they might get deleted automatically.

/var /var contains “variable” files that the system changes automatically. For example, incoming mail is stored here. The system keeps a log of its actions here. There are a number of other automatically generated files here as well. You’ll mostly be interested in the contents of /var/log, where you can find error messages that can help you figure out what you’re system’s up to if something goes wrong.

Clearly there are many more directories on the system—far too many to describe every one.

For changing things, you’ll usually want to confine yourself to your home directory and /etc. On a Debian system, there’s rarely an occasion to change anything else, because everything else is automatically installed for you.

/etc is used to configure the system as a whole. You’ll use your /own home directory, a subdirectory of /home, for configuring your own preferences and storing your personal data. The idea is that on a day-to-day basis, you confine yourself to /home/yourname, so there’s no way you can break anything. Occasionally you log in as root to change something in a system-wide directory, but only when it’s absolutely necessary. Of course, if you’re using Debian at a school or business and someone else is the system administrator, you won’t have root access and will be able to change only your home directory and any other directory that you own. This limits what you can do with the system.

7.3 File Compression with gzip

Often it would be nice to make a file smaller—say, to download it faster, or so it takes up less space on your disk. The program to do this is called gzip (GNU zip). Here’s how it works:

$ cd; cp /etc/profile ./mysamplefile

This switches to your home directory and copies an arbitrarily chosen file (/etc/profile) to your current directory, in the process renaming it mysamplefile. This gives you a file to play with when using gzip.

$ ls -l

Lists the contents of the current directory. Note the size of mysamplefile.

$ gzip mysamplefile

Compresses mysamplefile.

$ ls -l

Observe the results of this command: mysamplefile is now called mysamplefile.gz . It’s also a good bit smaller.

$ gunzip mysamplefile.gz; ls -l

This uncompresses the file. Observe that mysamplefile has returned to its original state. Notice that to uncompress, one uses gunzip, not gzip.

$ rm mysamplefile

Use this command to remove the file, since it was just to practice with.

7.4 Finding Files

There are two different facilities for finding files: find and locate. find searches the actual files in their present state. locate searches an index generated by the system every morning at 6:42 a.m. (this is a cron job, explained elsewhere in this book). locate won’t find any files that were created after the index was generated. However, because locate searches an index, it’s much faster—like using the index of a book rather than looking through the whole thing.

To compare the two ways of finding files, pretend you can’t remember where the X configuration file XF86Config resides.

$ locate XF86Config

This should be pretty fast. You’ll get a list of filenames that contain XF86Config, something like this:

/etc/X11/XF86Config / /usr/X11R6/lib/X11/XF86Config / /usr/X11R6/lib/X11/XF86Config.eg / /usr/X11R6/man/man5/XF86Config.5x.gz / / / / Now try the find command:

$ find / -name XF86Config

You will hear a lot of disk activity, and this will take a lot longer. Results will look something like this:

/etc/X11/XF86Config / /usr/X11R6/lib/X11/XF86Config / find: /var/spool/cron/atjobs: Permission denied find: /var/spool/cron/atspool: Permission denied find: /var/lib/xdm/authdir: Permission denied

Notice that find found only files that were named exactly XF86Config, rather than any files containing that string of letters. Also, find actually tried to look in every directory on the system—including some where you didn’t have read permissions. That’s why you got the Permission denied messages.

The syntax is different as well. With find, you had to specify what directory to search in, whereas locate automatically chose the root directory. And you had to specify a search by name using the -name option. You could also have searched for files using many other criteria, such as modification date or owner. To have find search for files whose names match XF86Config, you’d have to use a wildcard:

$ find / -name ’*XF86Config*’

Like most of the command line tools, find accepts wildcards as arguments.

In general, find is a more powerful utility, and locate is faster for everyday quick searches. The full range of possible searches would take a long time to explain; for more details , type info find, which will bring up the very thorough info pages on find and locate.

7.5 Determining a File’s Contents

Debian comes with a utility that can guess at the contents of a file for you. Although it is not 100% accurate, you can use the following command to explore your system:

$ file /bin/cp

You should see something like this:

/bin/cp: ELF 32-bit LSB executable, Intel 386, version 1 / / / / Skipping the technical parts, this is an executable file for Intel machines.

$ file /etc/init.d/boot

The preceding command gives this response:

/etc/init.d/boot: Bourne shell script text / / / / meaning that this is a text file containing a Bourne shell script.

7.6 Using a File Manager

Instead of moving files around by hand, you can use a file manager. If you move a lot of files around, a file manager can make your work more efficient. There are text-based file managers, such as GNU Midnight Commander (mc), and a number of file managers for the X Window system (for example gmc for the X Window version of GNU Midnight Commander).

Describing each of these is outside the scope of this book, but you may want to try them out if the command line doesn’t meet your needs.

8. Working with Text Files

Text files are prevelant on a GNU/Linux system. They hold everything from documentation to configuration files. Fortunately, it’s easy to work with them.

8.1 Viewing Text Files

A text file is simply a normal file that happens to contain human-readable text. There’s nothing special about it otherwise. The other kind of file, a binary file, is meant to be interpreted by the computer.

You can view either kind of file with the less file pager if you have it installed (install it if you haven’t, it’s quite useful). Type less /etc/profile to view a sample text file. Notice that you can read /the characters even if their meaning is obscure. Type less /bin/ls to view a binary file. As you can see, the ls program is not meant to be read by humans.

Sometimes, you’ll find files that end with .gz. These files may be viewed with zless; you can run it like so:

zless /usr/doc/ae/changelog.Debian.gz

Tip: zless is great for viewing documentation, which is often shipped in .gz form.

The difference between the two kinds of files is purely a matter of what they contain, unlike in some other systems (such as DOS and MacOS), which actually treat the files differently.

Text files can contain shell scripts, documentation, copyright notices, or any other human-readable text.

Incidentally, this illustrates the difference between source code and binary executables. /bin/ls is a binary executable you can download from Debian, but you can also download a text file that tells the computer how to create /bin/ls. This text file is the source code. Comparing /bin/ls to /etc/profile illustrates how important source code is if someone wants to understand and modify a piece of software. Free software provides you or your consultants with this all-important source code.

8.2 Text Editors

A text editor is a program used to create and change the contents of text files. Most operating systems have a text editor: DOS has edit, Windows has Notepad, MacOS has SimpleText.

Debian provides a large variety of text editors. vi and Emacs are the classic two, which are probably both the most powerful and the most widely used. Both vi and Emacs are quite complex and require some practice, but they can make editing text extremely efficient. Emacs runs both in a terminal and under the X Window system; vi normally runs in a terminal but the vim variant has a -g option that allows it to work with X. text editors

Simpler editors include nedit, ae, jed, and xcoral. nedit and xcoral provide easy-to-use X Window system graphical interfaces. There are also several vi variants. Additionally, you can find and a GNU Emacs variant called XEmacs.

This book does not cover the use of any particular editor in detail, though we will briefly introduce ae since it is small, fast, and can be found even on the Debian rescue disks, so it pays to know a bit about it for usage in a pinch. When you need to do more serious editing, check out vim or GNU Emacs. Emacs provides an excellent interactive tutorial of its own; to read it, load Emacs with the emacs command and type F1 t. Emacs is an excellent choice for new users interested in a general-purpose or programming editor.

8.3 Using ae

You can start ae by giving it the name of a file to edit, like so:

$ ae filename.txt

This will bring up an editor screen. The top part of this screen provides some quick help; the bottom shows the file you’re editing. Moving around in this editor is simple; just use the arrow keys. You can save the file by pressing C-x C-s and then exit the editor by pressing C-x C-c. Once you feel comfortable with the editor, you can press C-x C-h to turn off the help. That’s it! Knowing this will let you do basic editing. For programming or more detailed editing work, you’ll want to investigate other editors as discussed earlier.

9. The X Window System

This chapter describes the X Window system graphical user interface. It assumes that you have already successfully configured X as described in the Installation Manual (again, the install manual is not yet written; for now you will need to use the XFree86 HOWTO, the contents of /usr/doc/X11, and this chapter). Once you install X, you can enter the X environment by typing startx or via xdm, depending on your choice during configuration.

9.1 Introduction to X

A GUI (Graphical User Interface) is part and parcel of the Windows and Mac operating systems. It’s basically impossible to write an application for those systems that does not use the GUI, and the systems can’t be used effectively from the command line. GNU/Linux is more modular, that is, it’s made up of many small, independent components that can be used or not according to one’s needs and preferences. One of these components is the X Window system, or simply X.

This component is also sometimes called X11. Please note that “X Windows” is not correct.

X itself is a means for programs to talk to your mouse and video card without knowing what kind of mouse and video card you have. That is, it’s an abstraction of the graphics hardware. User applications talk to X in X’s language; X then translates into the language of your particular hardware. This means that programs only have to be written once, and they work on everyone’s computer.

In X jargon, the program that speaks to the hardware is known as an X server. User applications that ask the X server to show windows or graphics on the screen are called X clients. The X server includes a video driver, so you must have an X server that matches your video card.

The X server doesn’t provide any of the features one might expect from a GUI, such as resizing and rearranging windows. A special X client, called a window manager, draws borders and title bars for windows, resizes and arranges windows, and provides facilities for starting other X clients from a menu. Specific window managers may have additional features.

Window managers available on a Debian system include fvwm, fvwm2, icewm, afterstep, olvwm, wmaker, twm, and enlightenment. You’ll probably want to try them all and pick your favorite.

Neither the X server nor the window manager provide a file manager; that is, there aren’t any windows containing icons for your files and directories. You can launch a file manager as a separate application, and there are many of them available. The GNOME desktop project is developing an icon-based file manager and other GUI facilities. See the GNOME homepage for the latest news on this.

http://www.gnome.org/

A final feature of X is its network transparency, meaning that X clients don’t care if they’re talking to an X server on the same machine or an X server somewhere on the network. In practical terms, this means you can run a program on a more powerful remote machine but display it on your desktop computer.

9.2 Starting the X Environment

There are two ways to start X. The first is to start X manually when you feel like using it. To do so, log in to one of the text consoles and type startx. This will start X and switch you to its virtual console.

The second (and recommended) way to use X is with xdm or X Display Manager. Basically, xdm gives you a nice graphical login prompt on the X virtual console (probably VC 7), and you log in there.

By default, either method will also start an xterm, which is a small window containing a shell prompt. At the shell prompt, you can type any commands just as you would on a text VC. So you can follow all the examples in this book using xterm; the only difference between an xterm and the text console is that you don’t have to log on to the xterm because you already logged on to X.

There are also a lot of things you can do only in X, which are covered in this chapter.

One note: The default xterm window has a smallish font. If you have a small monitor or very high resolution or bad eyesight, you may want to fix this. Follow these steps:

1. Move the mouse pointer into the center of the xterm window. 2. Hold down the Control key and the right mouse button simultaneously. This will give you a font menu. 3. Point to the font you want and release the mouse button.

9.3 Basic X Operations

There are certain commonly used operations in X that you should familiarize yourself with. This section describes some of the basic operations that you may find useful.

9.3.1 The Mouse

The mouse in X works pretty much the same as the mouse on other systems, except that it has three buttons. If your mouse has only two, you can simulate the middle button by clicking both buttons simultaneously. This is kind of tricky and annoying, so investing in a $15 three-button mouse probably isn’t a bad idea. These are available from most computer retailers.

The buttons are numbered from left to right assuming you have a right-handed mouse. So button one is on the left, two is in the middle, and three is on the right. You may see either the numbers or the locations in documentation.

X has a simple built-in copy-and-paste facility. To select text to copy, you click and drag with the left mouse button. This should select the text to copy, assuming the application you’re using has copy-and-paste support. To paste the text, you click the middle mouse button in a different X application. For example, if you receive an e-mail containing an URL, you can select the URL with the left button and then click in your web browser’s “Location” field with the middle button to paste it in.

9.3.2 X Clients

Programs that communicate with the X server are called X clients. Most of these programs will ask the X server to display windows on the screen.

You start an X client the same way you start any other Debian program. Simply type the name of the client on the command line. Try typing xterm into an existing xterm window, and a new xterm client will appear on the screen.

You may notice that the original xterm is now useless, because your shell is waiting for the second xterm to finish. To avoid this problem, you can run the X client in the backgroundby adding a & after the command name like this: xterm &. If you forget, you can place a running process in the background. First suspend the process with CTRL-z, and then place it in the background with the bg command.

If you use a program often, your window manager will generally provide a way to put that program on a convenient graphical menu.

9.3.3 Troubleshooting

Sometimes when you launch an X client from a graphical menu, you won’t be able to see any error messages if it fails. You can find any error messages in the file ~/.xsession-errors.

9.3.4 Leaving the X Environment

To leave X, you need to use a menu. Unfortunately for beginners, this is different for every window manager, and for most window managers, it can be configured in many ways. If there’s an obvious menu, look for an entry like “Exit” or “Close Window Manager.” If you don’t see a menu, try clicking each of the mouse buttons on the background of the screen. If all else fails, you can forcibly kill the X server by pressing CTRL-ALT-Backspace. Forcibly killing the server destroys any unsaved data in open applications.

9.4 Customizing Your X Startup

When you start X, Debian runs some shell scripts that start your window manager and other X clients. By default, a window manager, an xconsole, and an xterm are started for you.

To customize your X startup, the file /etc/X11/config must contain the line allow-user-xsession. If it does not, log in as root and add the line now. Then log back in as yourself and continue the tutorial.

You can see how Debian’s X startup works in the file /etc/X11/ Xsession. Note that you can change the behavior of /etc/X11/Xsession by modifying the file /etc/X11/config, which specifies a few system-wide preferences.

To run the clients of your choice when X starts, you create an executable shell script called .xsession in your home directory.

$ touch ~/.xsession

This creates the file.

$ chmod u+x ~/.xsession

This makes the file executable.

Once .xsession is created, you need to edit it to do something useful with your favorite text editor. You can do anything you want to in this script. However, when the script’s process terminates, X also terminates.

In practical terms, this means that you often end the script with a call to exec. Whatever program you exec will replace the script process with itself, so commands found after the exec line will be ignored. The program you exec will become the new owner of the script process, which means that X will terminate when this new program’s process terminates.

Say you end your .xsession with the line exec fvwm. This means that the fvwm window manager will be run when X starts. When you quit the fvwm window manager, your X session will end, and all other clients will be shut down. You do not have to use a window manager here; you could exec xterm, in which case typing exit in that particular xterm would cause the entire X session to end.

If you want to run other clients before you use exec, you will need to run them in the background. Otherwise .xsession will pause until each client exits and then continue to the next line. See the previous section on running jobs in the background (basically you want to put an ampersand at the end, as in xterm &).

You can take advantage of this behavior, though. If you want to run commands at the end of your X session, you can have your .xsession run a window manager or the like and wait for it to finish. That is, leave off the exec and the &; just enter fvwm by itself. Then put the commands of your choice after fvwm.

It would probably help to look at a few sample .xsession files. In all the examples, replace fvwm with the window manager of your choice.

The simplest .xsession just runs a window manager:

exec fvwm

This will run fvwm, and the X session will end when fvwm exits. If you do it without the exec, everything will appear to behave the same way, but behind the scenes .xsession will hang around waiting for fvwm, and .xsession will exit after fvwm does. Using exec is slightly better because fvwm replaces .xsession instead of leaving it waiting. You can use the ps or top command to verify this.

A more useful .xsession runs a few clients before starting the window manager. For example, you might want some xterms and an xclock whenever you start X. No problem; just enter xterm & xterm & xclock & exec fvwm. Two xterms and an xclock start up in the background, and then the window manager is launched. When you quit the window manager, you’ll also quit X.

You might try it without the backgrounding just to see what happens. Enter this command: xterm xclock exec fvwm. xterm will start, and wait for you to exit it. Then xclock will start; you’ll have to exit xclock before fvwm will start. The commands are run in sequence, since the script waits for each one to exit.

You can use sequential execution to your advantage. Perhaps you want to keep track of when you stop working every day:

xterm & xclock & fvwm date >> ~/logout-time

This will fork off an xterm and an xclock and then run fvwm and wait for it to finish. When you exit fvwm, it will move on to the last line, which appends the current date and time to the file ~/logout-time.

Finally, you can have a program other than the window manager determine when X exits:

xclock & fvwm & exec xterm

This script will run xclock and fvwm in the background and then replace itself with xterm. When you exit the xterm, your X session will end.

The best way to learn how to use .xsession is to try some of these things out. Again, be sure you use chmod to make it executable; failure to do so is a common error.

10. Filesystems

A Debian system uses a filesystem to store and manage your data. This chapter introduces you to the filesystem, describes how to add and remove filesystems, and shows you how to back up your system.

10.1 Concepts

It’s probably a good idea to explain a little theory before discussing the mechanics of using disks. In particular, you must understand the concept of a filesystem. This can be a bit confusing because it has several meanings.

The filesystem refers to the whole directory tree, starting with the root directory /, as described in earlier chapters.

A filesystem in general means any organization of files and directories on a particular physical device. “Organization” means the hierarchical directory structure and any other information about files one might want to keep track of: their size, who has permission to change them, etc. So you might have one filesystem on your hard disk, and another one on each floppy disk.

“Filesystem” is also used to mean a type of filesystem. For example, MS-DOS and Windows 3.1 organize files in a particular way, with particular rules: Filenames can have only eight characters, for example, and no permission information is stored. Linux calls this the msdos filesystem. Linux also has its own filesystem, called the ext2 filesystem (version two of the ext filesystem). You’ll use the ext2 filesystem most of the time unless you’re accessing files from another operating system or have other special needs.

Any physical device you wish to use for storing files must have at least one filesystem on it. This means a filesystem in the second sense—a hierarchy of files and directories, along with information about them. Of course, any filesystem has a type, so the third sense will come into play as well. If you have more than one filesystem on a single device, each filesystem can have a different type—for example, you might have both a DOS partition and a Linux partition on your hard disk.

10.2 mount and /etc/fstab

This section describes how to mount a floppy or Zip disk, discusses the /dev directory, and addresses distributing the directory tree over multiple physical devices or partitions.

10.2.1 Mounting a Filesystem

On a GNU/Linux system there’s no necessary correspondence between directories and physical devices as there is in Windows, in which each drive has its own directory tree beginning with a letter (such as C:\).

Instead, each physical device such as a hard disk or floppy disk has one or more filesystems on it. In order to make a filesystem accessible, it’s assigned to a particular directory in another filesystem. To avoid circularity, the root filesystem (which contains the root directory /) is not stored within any other filesystem. You have access to it automatically when you boot Debian.

A directory in one filesystem that contains another filesystem is known as a mount point. A mount point is a directory in a first filesystem on one device (such as your hard disk) that “contains” a second filesystem, perhaps on another device (such as a floppy disk). To access a filesystem, you must mount it at some mount point.

So, for example, you might mount a CD at the mount point /cdrom. This means that if you look in the directory /cdrom, you’ll see the contents of the CD. The /cdrom directory itself is actually on your hard disk. For all practical purposes, the contents of the CD become a part of the root filesystem, and when you type commands and use programs, it doesn’t make any difference what the actual physical location of the files is. You could have created a directory on your hard disk called /cdrom and put some files in it, and everything would behave in exactly the same way. Once you mount a filesystem, there’s no need to pay any attention to physical devices.

However, before you can mount a filesystem or actually create a filesystem on a disk that doesn’t have one yet, it’s necessary to refer to the devices themselves. All devices have names, which are located in the /dev directory. If you type ls /dev now, you’ll see a pretty lengthy list of every possible device you could have on your Debian system. For a summary of some devices, see Table 2.1 on page [*]. A more thorough list can be found on your system in the file /usr/src/linux/Documentation/devices.txt.

To mount a filesystem, we want to tell Linux to associate whatever filesystem it finds on a particular device with a particular mount point. In the process, we might have to tell Linux what kind of filesystem to look for.

10.2.2 Example: Mounting a CD-ROM

As a simple demonstration, we’ll go through mounting a CD-ROM, such as the one you may have used to install Debian. You’ll need to be root to do this, so be careful; whenever you’re root, you have the power to manipulate the whole system, not just your own files. Also, these commands assume there’s a CD in your drive; you should put one in the drive now. Then start with the following command:

If you haven’t already, you need to either log in as root or gain root privileges with the su (super user) command. If you use su, enter the root password when prompted.

ls /cdrom

Use this command to see what’s in the /cdrom directory before you start. If you don’t have a /cdrom directory, you may have to make one using mkdir /cdrom.

mount

Simply typing mount with no arguments lists the currently mounted filesystems.

mount -t iso9660 CD-device /cdrom

For this command, you should substitute the name of your CD-ROM device for CD-device in the above command line. If you aren’t sure, /dev/cdrom is a good guess because the install process should have created this symbolic link on the system. If that fails, try the different IDE devices: /dev/hdc, etc. You should see a message like this: mount: block /device dev/hdc is write-protected, mounting read-only. / / / The -t option specifies the type of the filesystem, in this case iso9660. Most CDs are iso9660. The next argument is the name of the device to mount, and the final argument is the mount point. There are many other arguments for mount; see the manual page for details.

Once a CD is mounted, you may find that your drive tray will not open. You must unmount the CD before removing it.

ls /cdrom

Confirms that /cdrom now contains whatever is on the CD in your drive.

mount

Displays the list of filesystems again; notice that your CD drive is now mounted.

umount /cdrom

This unmounts the CD. It’s now safe to remove the CD from the drive. Notice that the command is umount with no “n,” even though it’s used to unmount the filesystem.

exit

Don’t leave yourself logged on as root. Log out immediately, just to be safe.

10.2.3 /etc/fstab: Automating the Mount Process

The file /etc/fstab (it stands for “filesystem table”) contains descriptions of filesystems that you mount often. These filesystems can then be mounted with a shorter command, such as mount /cdrom. You can also configure filesystems to mount automatically when the system boots. You’ll probably want to mount all of your hard disk filesystems when you boot, so Debian automatically adds entries to fstab to do this for you.

Look at this file now by typing more /etc/fstab. It will have two or more entries that were configured automatically when you installed the system. It probably looks something like this:

# /etc/fstab: static file system information. # / # / # # / # # <file system> <mount point> <type> <options> #<dump > <pass> # /dev/hda1 / ext2 defaults 0 1 / /dev/hda3 none swap sw 0 0 / proc /proc proc defaults 0 0 /dev/hda5 /tmp ext2 defaults 0 2 / /dev/hda6 /home ext2 defaults 0 2 / /dev/hda7 /usr ext2 defaults 0 2 / /dev/hdc /cdrom iso9660 ro,noauto 0 0 / /dev/fd0 /floppy auto noauto,sync 0 0 / / / / / The first column lists the device the filesystem resides on. The second lists the mount point, the third indicates the filesystem type. The line beginning by proc is a special filesystem. Notice that the swap partition (/dev/hda3 in the example) has no mount point, so the mount point column contains none.

The last three columns may require some explanation.

The fifth column is used by the dump utility to decide when to back up the filesystem. In most cases, you can put 0 here.

The sixth column is used by fsck to decide in what order to check filesystems when you boot the system. The root filesystem should have a 1 in this field, filesystems that don’t need to be checked (such as the swap partition) should have a 0, and all other filesystems should have a 2. It’s worth noting that the swap partition isn’t exactly a filesystem in the sense that it does not contain files and directories but is just used by the Linux kernel as secondary memory. However, for historical reasons, the swap partitions are still listed in the same file as the filesystems.

Column four contains one or more options to use when mounting the filesystem. You can check the mount manpage for a summary; see

← Previous chapterAll chaptersNext chapter →

Debian Gnu/linux : Guide to Installation and Usage · The Wunder Library — complete classics, free to read, with narration.

© 2026 Wunder Learning LLC · Terms & Privacy