Linux Cookbook PDF
Linux Cookbook PDF
Michael Stutz
PRESS
An imprint of No Starch Press, Inc.
San Francisco
00-046057
Preface
Because of its robust and stable nature, the Linux-based system is the choice of millions today. But
what some may not know is that the free software movement, of which Linux is a part, is very much
a counter-cultural phenomenon: the design by which it is produced and published is contrary to the
notions of proprietary, intellectual property that have dominated mainstream culture so long. While
some programmers turn their research into corporate-backed software that you cannot openly change,
share, or examine (but only purchase and run on your system), Linux and other free software is the
product of many individuals who courageously published and shared their research and work openly, for
everyone to benefit from.
I wrote this book because I want everyone to know how to use this software, because I think everyone deserves the freedom that comes with it. I dont willingly use proprietary softwarenot because
it is always inferior to free software but because its use precludes freedoms that I find I cannot exist
without . . . freedoms that should be everyones right by default in a free, open society. (See Chapter 1
[Introduction], page 9.)
I know that Linux isnt difficult to use, especially when compared with other software and operating
systems, but what was needed was a guide to show people how to use it to get things done: Oh, you
want to do that? Here, type this.
That explains the premise of the bookits a hands-on guide to getting things done on a Linux system,
designed for the everyday user who is not necessarily a computer programmer.
The traditional approach to the subject is to either provide laundry lists of all available commands and
applications, or focus on their use in a programming or otherwise technical environment. This book takes
a different approach, showing how everyday usersbe they artists, designers, businessmen, scholars, or
scientistscan use these tools and applications to get things done. When I speak of things, I mean
(hopefully) the kind of things that youthe sort of person possibly and partially described above
might want to do with a modern computer system: view text and images, play and record sounds, perform
mathematic operations, print to your printer, format text, access the Internet, check your grammar, and
so forth.
Like a culinary cookbook, this book presents recipes for preparing or accomplishing a particular,
specific thing. Ive selected what I consider to be the easiest and most effective methods for accomplishing particular tasks, and have arranged these recipes in general sections according to subject matterthe
first part of the book is all about getting started, and contains the most essential information you need
to know about using Linux; the remaining chapters deal with general categories of usage: Files, Text,
Images, Sound, Productivity, and Networking.
Format of Recipes
Each recipe is numbered with at least two figures. These figures are constructed as follows: the first
number always corresponds to the chapter number, and the second to the section of the recipe. For
example, Chapter 3 is The Shell, and Recipe No. 3.5 is the fifth recipe on shells, Section 3.5 [Recording
a Shell Session], page 41.
Sometimes recipes are divided into subsections, with a third number specifying the specific recipe
for example, Recipe No. 3.4 is on the subject of command history in the shell, and is divided further
into subsections; Recipe No. 3.4.2 is the second recipe on command history, Section 3.4.2 [Specifying a
Command from Your History], page 41.
Each recipe describes a method for completing a specific task on the system; these tasks require at
least one software program. The software programs or files a recipe calls for are its ingredients.
The recipes are structured as follows:
1. Recipe number and title of the recipe.
2. Special ingredients, if any. The Debian package(s) and/or or URLs where the program(s) can be
obtained are listed, if they are available.
3.
4.
5.
6.
7.
8.
9.
Debian classifies packages in varying level of importance, from required packages that all
systems must have in order to run, to optional and extra packages that you only install if
you want them. If a described software package is in the first two given categoriesrequired
and importantthen I assume you have it installed, and the package name isnt listed here.
In the rare case that a software package I describe is not yet available as a Debian package, I just
give the URL where to obtain the source packages for that software; have your system administrator
install it.
Special preparation methods or description, if any. When a configurable program is described, the
standard setup as provided by the Debian distribution is assumed, unless otherwise specified here.
Description of the recipe and cooking method proper.
Remarks concerning the results and use.
Bulleted example of the method in a specific context.
Extra commands or actions you might want to do next.
Variations on the recipe, with additional examples.
Special notes or references to further information.
Not all of these items may be present in a given recipe.
duction], page 9.
and are the responsible party for ensuring that any administrative tasks be completed; Appendix A [Administrative Issues], page 315 exists as a reference for those users who will be administrating their own
systems.
Typographical Conventions
All recipes have at least one example that demonstrates it.
The text that describes what the example does appears just before the example itself, and is offset
from the text with a bullet, like this.
A given recipe may have several variations; each is offset with its own bullet.
The names of documents or users that are used in some recipes may not always reference actual
documents or users on your system, but demonstrate the general principles involved. So when I
show how to print a file called resume, you might not necessarily have a file with that name on
your system, but you should understand the idea which the recipe demonstrates.
$
In examples where a shell prompt is displayed, the default current working directory is omitted in the
prompt and just a $ is used; when a command outputs text and then exits, the last line of an example
contains a $ character to denote the return to a shell prompt. Dont worry if this sounds strange to you
now; all of this shell business is explained in Chapter 3 [The Shell], page 33.
When a command exits and returns to the shell prompt without outputting text, the final shell prompt
character is omitted, and a cartouche border is not drawn around the example; this was purely an aesthetic
decision.
The names of files or directories appear in the text as file; commands appear as command, and
strings of text are typeset like some text.
Text you type is written like this, just as in the examples, and when a specific key on the keyboard
is mentioned, its conventional name is displayed in a box. For example, RET denotes the Return key
on the keyboard.
In examples where keys are meant to be pressed and held down together, the keys are separated by
hyphens; the hyphens are not meant to be literally pressed. For example, pressing the CTRL, ALT, and
DEL keys and holding them down at the same time is a combination that has meaning in some operating
systems (including Linux, where this keystroke means to shut down the system and reboot the computer);
it is represented like this:
CTRL-ALT-DEL
The CTRL (Control) key is always used in combination with another key; these combinations are
denoted by C-x , where x is the second key. These combinations are read as control-x , where x is
the name of the second key. To type one of these combinations, press and hold CTRL, press the second
key, and then release both keys.
This key is labelled Enter on some keyboards.
For example, to type C-d (pronounced control d), press and hold CTRL, type the D key, and
then release both keys.
In some applications (notably, the Emacs editor; see Section 10.2 [Emacs], page 108), the META key
is used with another key, in the same way as SHIFT; these combinations are denoted by M-x , where x
is the second key. Most keyboards today dont have a META key, even though the term is still in use;
instead, press and release ESC, and then type the second key.
To type M-c, press and release ESC, and then press and release the C key.
You can sometimes also use the ALT key for the META key. This often does not work in the X
Window System, but in the console you can press and hold ALT and then type the second key just as you
would with a CTRL key sequence.
So to type M-c with the ALT key, press and hold ALT, press the C key, and then release both keys.
Both CTRL and META sequences are not case-sensitive; that is, pressing X in the last example is the
same as pressing x (although x is certainly easier to type). By convention, the C- or M- prefix is always
given as an uppercase letter, and the key which follows is always given as a lowercase letter.
Menu items in an application are written like Menu Item; the names of command functions are
written as Function.
For aesthetic purposes, a physical space appears in the text between commands and the finalRET that
ends a command line, and should not be literally typed (although nothing bad will happen should you
actually type this space). Where explicitly pressing the space bar is called for, that key is represented in
examples by SPC.
The Linux Cookbook is available in both hardcopy and as a machine-readable file. The latest
edition of this book in etext (electronic text) form is always available from its distribution site
(http://dsl.org/cookbook/) on the World Wide Web. This site includes the most up-to-date
complete text (in both HTML and GNU Info formats), and provides a method for purchasing the latest
edition of the hardcopy book at a discount.
Every effort has been made to include only the best free software recipes for accomplishing tasks in
the easiest and most efficient manner, and they are believed to be correct. Suggestions, comments, and
bug reports are always welcome; you can contact the author via email at stutz@dsl.org.
Acknowledgments
This is not a book that was borne easily. Conception, took but an idle momentbut once the idea
had been implanted, I found resistance and setbacks at every turn. It was only through the help of the
following individuals that this book with my name on its cover was finally brought forth, and has now
found its way to you.
Everyone involved with this book at No Starch Press (http://www.nostarch.com/) deserves
a hearty round of thanks. Bill Pollock has published this book precisely according to its authors vision,
and had the discernment and foresight to allow that a copylefted edition (with corresponding source
data) be made available in conjunction with the hardcopy book. Project manager Karol Jurado worked
ceaselessly to keep the production flowing, while dealing with my input files, and giving opinion and
advice on all manners of obtuse esoterica whenever the sudden need to know came over me. Both
Elisabeth Beller and Andy Carroll contributed improvements to the text.
Steve Turner and the National Writers Union (http://www.nwu.org/) played a major role in
helping to ensure that this book could be completed, copylefted, and in the hands of Linux users like
yourself. Carol Criccow gave invaluable legal assistance, and various advice and assistance came from
the NWUs JoAnn Kawell, Philip Mattera, Judy Helm, and Bonnie Britt.
Wendy Seltzer, Fellow, The Berkman Center for Internet & Society at Harvard Law School
(http://cyber.law.harvard.edu/) assisted with the conception of the Design Science License
(DSL), which is used in this book. She gave an initial review of the license draft and provided her expertise and advice throughout the entire process.
Thanks to David Sims, Chris Coleman, and Terrie Schweitzer, whove all been great folks to work
with at the OReilly Network (http://oreillynet.com/), where my Living Linux column runs.
I am indebted to Buwei Yang Chao, whose How To Cook and Eat In Chinese (John Day Company,
1945) served as much of the inspiration behind the tone and structure of this book. I feel the same
regard for two other authors who have come before me, and whose work has had a direct influence in the
writing of this bookDr. Lee Su Jan (The Fine Art of Chinese Cooking, Gramercy Publishing 1962)
and Andrew Walker (The UNIX Environment, Wiley 1984).
Thanks also go out to Kenneth W. Melvin, and to the members of the Byline forum on the WELL;
both were sources of advice and feedback early in the project. The art-hackers of the linart mailing
list (http://linart.net/) entertained initial discussion of the idea of this book as it first occurred,
and the elders Ann and Walt gave various support for which I am grateful.
Finally, I must thank Jack Angelotta, Jon Konrath, Steven Snedker, and mrs (Marie Stutz), who all
listened to the unbelievable as it happened, and stood byeven in moments of terror.
1 Introduction
Before we get into cooking and the recipes proper, this first part of the book deals with preliminaries,
explaining the general techniques and methods for working with Linuxincluding how to get the system
ready for use, and how to run commands on the system.
The rest of the book is all recipes, which are sorted in sections by the tasks they perform or the objects
they work onsuch as text, files, images, and so forth.
free software systems to be the effective realization of their goalshence the GNU in Debian GNU/Linux.
inally written by Bruce Perens as a set of software inclusion guidelines for Debian. All free software
including software released under the terms of the GNU General Public Licenseconforms with this
definition.
But some free software advocates and organizations, including the GNU Project, do not endorse the
term open source at all, believing that it obscures the importance of freedom in this movement.
Whether you call it free software, open source software, or something else, there is one fundamental
difference between this kind of software and proprietary, non-free softwareand that is that free software
always ensures that everyone is granted certain fundamental freedoms with respect to that software.
include all other kinds of free worksincluding works of literature and music.
-x; while the 1990s were fast becoming the freaky alterna decade (at least in fashion), more people seemed to favor
Linux, and the name stuck.
The GNU Projects own kernel is called Hurd, and is still in development; Debians experimental distribution of a Hurdbased free softare system, not yet publicly released, is called Debian GNU/Hurd.
is very well-received in Europe. So when people speak of Debian, Red Hat, SuSE, and the like in terms
of Linux, theyre talking about the specific distribution of Linux and related software, as assembled
and repackaged by these companies or organizations (see Appendix B [Linux Resources on the Web],
page 321). The core of the distributions are the sametheyre all the Linux kernel, the GNU Project
software, and various other free softwarebut each distribution has its own packaging schemes, defaults,
and configuration methods. It is by no means wrong to install and use any of these other distributions,
and every recipe in this book should work with all of them (with the exception of variations that are
specific to Debian systems, and are labelled as such in the text).
In Debians early days, it was referred to as the hackers distro, because it could be very difficult
for a newbie to install and manage. However, that has changedany Linux newbie can install and use
todays Debian painlessly.
NOTE: I recommend Debian because it is non-corporate, openly developed, robust (the standard Debian
CD-ROM set comes with more than 2,500 different software packages!), and it is entirely committed to
free software by design (yes, there are distributions which are not).
Just as the tensile strength of steel is greater than the added strength of its componentsnickel, cadmium, and ironmultiple tools could then be combined to perform a task unpredicted by the function of
the individual tools. This is the concept of synergy, and it forms the basis of the Unix tools philosophy.
Heres an example, using two tools. The first tool, called who, outputs a list of users currently logged
on to the system (see Section 2.6.2 [Listing Who Is on the System], page 23). The second tool is called
wc, which stands for word count; it outputs a count of the number of words (or lines or characters) of
the input you give it (see Section 12.1 [Counting Text], page 133).
By combining these two tools, giving the wc command the output of who, you can build a new
command to list the number of users currently on the system:
$ who | wc -l
4
$
RET
The output of who is pipedvia a pipeline, specified by the vertical bar (|) characterto the
input of wc, which through use of the -l option outputs the number of lines of its input.
In this example, the number 4 is shown, indicating that four users are currently logged on the system.
(Incidentally, piping the output of who to wc in this fashion is a classic tools example, and was called
the most quoted pipe in the world by Andrew Walker in The UNIX Environment, a book that was
published in 1984.)
Another famous pipeline from the days before spell-check tools goes something like this:
$ tr -cs A-Za-z \012 | tr A-Z a-z | sort -u |
comm -23 - /usr/dict/words RET
This command (typed all on one line) uses the tr, sort, and comm tools to make a spelling
checkerafter you type this command, the lines of text you type (until you interrupt it) are converted
to a single-column list of lowercase words with two calls of tr, sorted in alphabetical order while ferreting out all duplicates, the resultant list which is then compared with /usr/dict/words, which
is the system dictionary, a list of properly-spelled words kept in alphabetical order (see Section 11.1
[Spelling], page 121).
Collective sets of tools designed around a certain kind of field or concept were called workbenches
on older Unix systems; for example, the tools for checking the spelling, writing style and grammar of
their text input were part of the Writers Workbench package (see Section 11.3 [Checking Grammar],
page 127).
Today the GNU Project publishes collections of tools under certain general themes, such as the GNU
text utilities and GNU file utilities, but the idea of workbenches is generally not part of the idiom
of todays Unix-based systems. Needless to say, we still use all kinds of tools for all kinds of purposes;
the great bulk of this book details various combinations of tools to obtain the desired results for various
common tasks.
Youll find that theres usually one tool or command sequence that works perfectly for a given task,
but sometimes a satisfactory or even identical result can be had by different combinations of different
toolsespecially at the hands of a Unix expert. (Traditionally, such an expert was called a wizard.)
Some tasks require more than one tool or command sequence. And yes, there are tasks that require
more than what these simple craft or hand tools can provide. Some tasks need more industrial production
techniques, which are currently provided for by the application programs. So we still havent avoided
applications entirely; at the turn of the millennium, Linux-based systems still have them, from editors to
browsers. But our applications use open file formats, and we can use all of our tools on these data files.
Because of this approach, and because of its free and open nature, I have come to call Linux a synergetic operating system,
in honor of the late R. Buckminster Fuller, who invented a new mathematical system based on these same principles.
The invention of new tools has been on the rise along with the increased popularity of Linux-based
systems. At the time of this writing, there were a total of 1,190 tools in the two primary tool directories
(/bin and /usr/bin) on my Linux system. These tools, combined with necessary applications,
make free, open source softwarefor perhaps the first time in its historya complete, robust system for
general use.
Finally, you can hire a consultant. This may be a good option if you need work done right away and
are willing to pay for it.
The Linux Consultants HOWTO is a list of consultants around the world who provide various
support services for Linux and open source software in general (see Section 2.8.6 [Reading System
Documentation and Help Files], page 31). Consultants have various interests and areas of expertise,
and they are listed in that document with contact information.
This separation is accomplished by giving each individual user an account on the system. You need
an account in order to use the system; with an account you are issued an individual workspace to use,
and a unique username that identifies you to the system and to other users. It is the name that the system
(and those who use it) will then forever know you as; its a single word, in all lowercase letters.
During the installation process, the system administrator should have created an account for you.
(The system administrator has a special account whose username is root; this account has total access
to the entire system, so it is often called the superuser.)
Until the mid-1990s it was widely common for usernames to be the first letter of your first name
followed by your entire surname, up to 12 characters total. So for example, user Samuel Clemens would
have a username of sclemens by this convention; this, however, is not a hard and fast rule, especially on home systems where you may be the only user. Sometimes, a middle initial may be used
(dkjohnson), or sometimes even nicknames or initials are used (zenboy, xibo). But whatever username you pick for yourself, make sure its one you can live with, and one you can stand being
called by both the system and other users (your username also becomes part of your email address, as
well see in Chapter 30 [Email], page 275).
In addition to your username, you should also have a password that you can keep secret so that only
you can use your account. Good passwords are strings of text that nobody else is likely to guess (i.e., not
obvious words like secret, or identifying names like Ruski, if that happens to be your pet cat).
A good password is one that is highly memorable to you so that you dont have to write it down, but
is complex enough in construction so that anyone else couldnt ever guess it. For example, t39sAH
might be a fine password for someone whose first date was to see the movie The 39 Steps directed by
Alfred Hitchcock.
NOTE: While usernames are always in lowercase, passwords are case sensitive; the passwords
Secret, secret, and SECRET are all considered different.
bardo login:
Every Linux system has its own name, called the systems hostname ; a Linux system is sometimes
called a host, and it identifies itself with its hostname at the login: prompt. Its important to name your
systemlike a username for a user account, a hostname gives name to the system you are using (and it
becomes especially important when putting the system on a network). The system administrator usually
names the system when it is being initially configured (the hostname can always be changed later; its
name is kept in the file /etc/hostname). Like usernames, hostnames are one word in all lowercase
letters. People usually give their system a name they like, such as darkstar or shiva.
In this example, bardo is the hostname of this particular Linux system.
The name of the terminal you are connecting from is displayed just after the hostname. In this
example, the terminal is tty1, which means that this is the first terminal on this particular system.
(Incidentally, tty is short for teletype, which historically was the kind of terminal hardware that
most Unix-based systems used by default.)
To log in to the system, type your username (followed by RET) at the login: prompt, and then
type your password when asked (also followed by RET); for security purposes, your password is not
displayed on the screen when you type it.
To log in to the system with a username of kurt and a password of empathy, type:
Once youve entered your username and password, you are logged in to the system. You can then
use the system and run commands.
As soon as you log in, the system displays the contents of /etc/motd, the Message of the Day
file. The system then displays the time and date of your last login, and reports whether or not you have
electronic mail waiting for you (see Chapter 30 [Email], page 275). Finally, the system puts you in a
shellthe environment in which you interact with the system and give it commands. Use of the default
shell on most Linux systems, bash, is discussed in Chapter 3 [The Shell], page 33.
The dollar sign ($) displayed to the left of the cursor is called the shell prompt ; it means that the
system is ready and waiting for input. (You can change this prompt to any text of your liking; to learn
how, see Section 3.6.1 [Changing the Shell Prompt], page 42.) By default, the shell prompt includes the
name of the current directory, which it places to the left of the $ character. The tilde character (), is
a shell symbol that denotes the users home directorywhen you log in, you are in your home directory
(these terms are defined in Chapter 5 [Files and Directories], page 59).
$ logout
RET
bardo login:
What works equally well to typing the logout command is to just type C-d (hold down CTRL and
press D). You dont even have to type RET afterwards. Many users prefer this quick shortcut.
Logging out of the system frees the terminal you were usingand ensures that nobody can access
your account from this terminal.
If you are the only person using your system and have just ended a session by logging out, you might
want to power down the system. See Section 2.1.2 [Shutting Down the System], page 17, earlier in this
chapter.
bardo login:
You can also cycle through the different virtual consoles with the left and right arrow keys. To switch
to the next-lowest virtual console (or wrap around to the highest virtual console, if youre at the first
virtual console), press ALT-. To switch to the next-highest virtual console, press ALT-.
bardo login:
The seventh virtual console is reserved for the X Window System. If X is installed, this virtual
terminal will never show a login: prompt, but when you are using X, this is where your X session
appears. If your system is configured to start X immediately, this virtual console will show an X login
screen.
You can switch to a virtual console from the X Window System using CTRL in conjunction with the
usual ALT and function keys. This is the only console manipulation keystroke that works in X.
To view this older text, press SHIFT-PgUp to scroll back through it.
Once you have scrolled back, press SHIFT-PgDn to scroll forward through the text toward the most
recent text displayed on the console.
The amount of text you can scroll back through depends on system memory.
NOTE: This technique is for scrolling through text displayed in your shell session (see Chapter 3 [The
Shell], page 33). It does not work for scrolling through text in a tool or application in the consolein
other words, you cant use this technique to scroll through text that is displayed by a tool for perusing
text files. To scroll through text in an application, use its own facilities for scrolling, if it has any.
D ESCRIPTION
Switch to virtual console n, where n is a number from 1 to 7 (the
default maximum).
CTRL-ALT-Fn
ALT-
ALT-
SHIFT-PgUp
SHIFT-PgDn
RET
Long-style options (sometimes called GNU-style options) begin with two hyphen characters (--)
and are usually one English word.
For example, many tools have an option, --version, to output the version number of the tool.
(Many tools also have a --help option, which outputs a list of options the tool takes; see Section 2.8.3
[Listing the Usage of a Tool], page 27.)
RET
This command outputs the text hostname 2.10, indicating that this is version 2.10 of the
hostname tool.
Sometimes, an option itself may may take an argument. For example, hostname has an option for
specifying a file name to use to read the hostname from, -F; it takes as an argument the name of the
file that hostname should read from.
To run hostname and specify that the file host.info is the file to read from, type:
$ hostname -F host.info
RET
$ passwd RET
Changing password for kurt
Old password: your current password RET
Enter the new password (minimum of 5, maximum of 8 characters)
Please use a combination of upper and lower case letters and numbers.
New password: your new password RET
Re-enter new password: your new password RET
Password changed.
$
NOTE: Passwords can contain uppercase and lowercase letters, the digits 0 through 9, and punctuation
marks; they should be between five and eight characters long. See Section 2.2 [Accounts and Privileges],
page 17, for suggestions on choosing a good password.
$ whoami
kurt
$
RET
In this example, the username of the user logged in at this terminal is kurt.
$ who
murky
dave
kurt
kurt
$
RET
tty1
tty2
tty3
ttyp1
Oct
Oct
Oct
Oct
20
21
21
21
20:09
14:37
15:04
15:04 (:0.0)
The output in this example shows that the user murky is logged in on tty1 (the first virtual console
on the system), and has been on since 20:09 on 20 October. The user dave is logged in on tty2
(the second virtual console), and has been on since 14:37 on 21 October. The user kurt is logged in
twiceon tty3 (the third virtual console), and ttyp1, which is an X session with a window location
of (:0.0).
NOTE: This command is for listing the users on the local system; to list the users connected to a different
system on the network, or to see more detailed information that a user may have made public about
himself, see Section 32.4.2 [Checking Whether a User Is Online], page 306.
$ w RET
5:27pm
USER
murky
dave
kurt
kurt
$
In this example, the commands output shows that the current system time is 5:27 p.m., the system
has been up for 17 hours and 53 minutes, and there are four users currently logged in: murky is logged
in at tty1, has been idle for 17 hours and 22 minutes, and is at a bash shell prompt; dave is logged in
at tty2, has been idle for 13 seconds, and is using less to peruse a file called foo (see Section 9.1
[Perusing Text], page 99); and kurt is logged in at two terminalstty3 and ttyp1, which is an X
session. He ran the startx command on tty3 to start his X session, and within his X session, he is
currently using Emacs.
To find out when a particular user last logged in to the system, give his username as an argument.
To find out when user kurt last logged in, type:
$ last kurt RET
NOTE: The last tool gets its data from the system file /var/log/wtmp; the last line of output
tells how far this file goes back. Sometimes, the output will go back for several weeks or more.
$ ps RET
PID TTY STAT TIME COMMAND
193
1 S
0:01 -bash
204
1 S
0:00 ps
$
In this example, ps shows that two processes are running: the bash and ps commands.
NOTE: This command is useful for listing all of your own processes, across all terminals and shell
sessions; give your own username as an argument.
NOTE: There could be a lot of outputeven single-user Linux systems typically have fifty or more
processes running at one timeso you may want to pipe the output of this command through less for
perusal (see Section 9.1 [Perusing Text], page 99).
Additionally, use top to show a display of all processes on the system, sorted by their demand on
the system resources. The display is continually updated with current process information; press Q to
stop the display and exit the program. This tool also displays the information about system runtime and
memory that can be output with the uptime and free commands.
To display a continually updated display of the current system processes, type:
$ top RET
To list the process (if any) which corresponds to a process ID, give that PID as an argument to the
-p option.
To list the process whose PID is 344, type:
$ ps -p 344 RET
$ apropos consoles
console (4)
gpm (1)
RET
NOTE: The apropos tool only finds exact matches, so a search for the keyword console might not
list the programs that a search for the keyword consoles would yield, and vice versa.
Another way to find tools by keyword is to search the system manual pages (see Section 2.8.4 [Reading a Page from the System Manual], page 28). To do this, use man and give the text to search for as an
argument to the -k option. This searches the short descriptions and manual page names for the given
text, and outputs a list of those tools that match in the same format as the apropos tool.
To output a list of all tools whose pages in the system manual contain a reference to consoles, type:
$ man -k consoles
RET
On Debian systems, yet another way to find installed software by keyword is to use dpkg, the Debian
package tool. Use the -l option to list all of the installed packages, which are each output on a line of
their own with their package name and a brief description.
You can output a list of packages that match a keyword by piping the output to grep. Use the -i
option with grep to match keywords regardless of case (grep is discussed in Chapter 14 [Searching
Text], page 147).
Additionally, you can directly peruse the file /var/lib/dpkg/available; it lists all available
packages and gives a description of them.
RET
To list all of the packages whose name or description contains the text edit, regardless of case,
type:
$ dpkg -l | grep -i edit
RET
RET
RET
NOTE: The whatis tool gets its descriptions from the manual page of a given program; manual pages
are described later in this section, in Section 2.8.4 [Reading a Page from the System Manual], page 28.
This command outputs some usage information about the whoami tool, including a short description
and a list of possible options.
NOTE: Not all tools take the --help option; some tools take a -h or -? option instead, which
performs the same function.
In the olden days, the hardcopy reference manual that came with most Unix systems also existed electronically on the system itself; each software program that came with the system had its own manual page
(often called a man page) that described it. This is still true on Linux-based systems today, except they
dont always come with a hardcopy manual.
Use the man tool to view a page in the system manual. As an argument to man, give the name of
the program whose manual page you want to view (so to view the manual page for man, you would type
man man).
RET
Use the up and down arrow keys to move through the text. Press Q to stop viewing the manual
page and exit man. Since man uses less to display the text, you can use any of the less keyboard
commands to peruse the manual page (see Section 9.1 [Perusing Text], page 99).
Despite its name, a manual page does not always contain the complete documentation to a program,
but its more like a quick reference. It usually gives a short description of the program, and lists the
options and arguments it takes; some manual pages also include an example or a list of related commands.
(Sometimes, commands have very complete, extensive manual pages, but more often, their complete
documentation is found either in other help files that come with it or in its Info documentation; these are
subjects of the following two recipes.)
To prepare a man page for printing, see Section 25.3.4 [Preparing a Man Page for Printing], page 243.
This command starts info at the systems Top menu, which shows some of the info key commands
and displays a list of available manuals:
Use the arrow keys to move through each page of information, called an Info node. Nodes are the
base unit of information in Info, and are arranged hierarchicallya manuals Top node will contain an
Info menu containing links to its various chapters, and a chapter node will contain a menu with links for
its sections, and so on. Links also appear as cross references in the text.
Links look the same in both menu items and cross references: an asterisk (*), the name of the node
it links to, and either one or two colon characters (:). To follow a link to the node it points to, move
the cursor over any part of the node name in the link and press RET.
To run a tutorial that describes how to use info, press the H key. Press Q at any time to stop
reading the documentation and exit info.
To read Info documentation for a tool or application, give its name as an argument to info; if no
Info manual exists for that tool, info displays the man page for that tool instead.
To read the Info documentation for the tar tool, type:
$ info tar RET
This command starts info and opens the Info file faq.info, beginning at the top node in the
file.
To read a specific node in an Info file, give the name of the node to use in quotes as an argument to
the -n option.
To read faq.info, an Info file in the current directory, beginning with the node Text, type:
RET
NOTE: You can also read Info documentation directly from the Emacs editor; you type C-h i from
Emacs to start the Info reader, and then use the same commands as in the standalone info tool (see
Section 10.2.1 [Getting Acquainted with Emacs], page 109).
The Emacs incremental search command, C-s, also works in info; its a very fast, efficient way
to search for a word or phrase in an entire Info text (like this entire book); see Section 14.6.1 [Searching
Incrementally in Emacs], page 154.
NOTE: Its often very useful to use a Web browser to browse through the documentation files in these
directoriessee Section 5.9 [Browsing Files], page 73.
On some systems, /usr/doc is superseded by the /usr/share/doc directory.
LDP documents are available in other formats as well, including HTML and DVI.
3 The Shell
The subject of this chapter is the shell, the program that reads your command input and runs the specified
commands. The shell environment is the most fundamental way to interact with the systemyou are
said to be in a shell from the very moment youve successfully logged in to the system.
The $ character preceding the cursor is called the shell prompt ; it tells you that the system is ready
and waiting for input. On Debian systems, the default shell prompt also includes the name of the current
directory (see Chapter 5 [Files and Directories], page 59). A tilde character () denotes your home
directory, which is where youll find yourself when you log in.
For example, a typical users shell prompt might look like this:
$ _
If your shell prompt shows a number sign (#) instead of a $, this means that youre logged in
with the superuser, or root, account. Beware: the root account has complete control over the system;
one wrong keystroke and you might accidentally break it something awful. You need to have a different
user account for yourself, and use that account for your regular use (see Section A.3.1 [Making a User
Account], page 318).
Every Linux system has at least one shell program, and most have several. Well cover bash, which
is the standard shell on most Linux systems. (Its name stands for Bourne again shella pun on the
name of Steve Bourne, who was author of the traditional Unix shell, the Bourne shell.)
NOTE: See Info file bashref.info, node Top, for more information on using bash.
DEL
RET
Send the command line to bash for execution (in other words, it runs
the command typed at the shell prompt). You dont have to be at the
far right end of the command line to type RET; you can type it when
the cursor is anywhere on the command line.
C-a
C-d
C-e
C-k
Kill, or cut, all text on the input line, from the character the cursor is
underneath to the end of the line.
C-l
C-u
C-y
Yank, or paste, the text that was last killed. Text is inserted at the
point where the cursor is.
C-_
and
Cycle through the command history (see Section 3.4 [Command History], page 40).
NOTE: These keyboard commands are the same as those used by the Emacs editor (see Section 10.2
[Emacs], page 108). Many other Emacs keyboard commands also work on the command line (see Section 10.2.2 [Basic Emacs Editing Keys], page 111). And, for Vi aficionados, it is possible to configure
bash to recognize Vi-style bindings instead.
The following sections describe some important features of command line editing, such as quoting
special characters and strings, letting the shell complete your typing, re-running commands, and running
multiple commands. See Info file bashref.info, node Command Line Editing for more information on bashs command line editing features.
Backspace.
\e
Escape.
\f
Form feed.
\n
Newline.
\r
Carriage return.
\t
Horizontal tab.
\v
Vertical tab.
\\
Backslash.
\NNN
Character whose ASCII code is NNN in octal (base 8).
To demonstrate the passing of special character sequences to tool, the following examples will use
the figlet tool, which displays the text you give as an argument in a font made up of text characters
(see Section 16.3.1 [Horizontal Text Fonts], page 178).
The key moves the last command you typed back to the input line, and RET executes it.
By typing more than once, you can go back to earlier commands youve typed; this is a function
of your command history, which is explained in full in Section 3.4 [Command History], page 40.
Additionally, you can use the bash reverse-incremental search feature, C-r, to search, in reverse,
through your command history. Youll find this useful if you remember typing a command line with
foo in it recently, and you wish to repeat the command without having to retype it. Type C-r followed
by the text foo, and the last command you typed containing foo appears on the input line.
Like the Emacs command of the same name (see Section 14.6.1 [Searching Incrementally in Emacs],
page 154), this is called an incremental search because it builds the search string in character increments
The Unix way of saying it is that the command rings the system bell.
as you type. Typing the string cat will first search for (and display) the last input line containing a
c, then ca, and finally cat, as you type the individual characters of the search string. Typing C-r
again retrieves the next previous command line that has a match for the search string.
To put the last command you entered containing the string grep back on the input line, type:
$ C-r
(reverse-i-search): grep
To put the third-to-the-last command you entered containing the string grep back on the input line,
type:
$ C-r
(reverse-i-search): grep
C-r C-r
When a command is displayed on the input line, type RET to run it. You can also edit the command
line as usual.
RET
If you redirect standard output to an existing file, it will overwrite the file, unless you use the >>
operator to append the standard output to the contents of the existing file.
To append the standard output of apropos shells to an existing file commands, type:
$ apropos shells >> commands RET
As with the standard output, use the >> operator instead of > to append the standard error to the
contents of an existing file.
To append the standard error of apropos shells to an existing file command.error, type:
$ apropos shells 2>> command.error RET
To redirect both standard output and standard error to the same file, use &> instead.
To redirect the standard output and the standard error of apropos shells to the file
commands, type:
$ apropos shells &> commands RET
This redirects the standard output of the command apropos bash shell shells to the standard
input of the command less, which displays it on the screen.
Stopped
info -f cookbook.info
In this example, the job number is 1 and the command that has stopped is info -f
cookbook.info. The + character next to the job number indicates that this is the most recent job.
If you have any stopped jobs when you log out, the shell will tell you this instead of logging you out:
$ logout RET
There are stopped jobs.
$
At this point you can list your jobs (see Section 3.3.4 [Listing Your Jobs], page 39), stop any jobs you
have running (see Section 3.3.5 [Stopping a Job], page 39), and then log out.
To run the command apropos shell > shell-commands as a background job, type:
RET
The shell outputs the job number (in this case, 1) and process ID (in this case, 6575), and then returns
to a shell prompt. When the background job finishes, the shell will list the job number, the command,
and the text Done, indicating that the job has completed successfully:
[1]+
Done
To move a job from the foreground to the background, first suspend it (see Section 3.3.1 [Suspending
a Job], page 38) and then type bg (for background).
For example, to start the command apropos shell > shell-commands in the foreground,
suspend it, and then specify that it finish in the background, you would type:
RET
If you have suspended multiple jobs, specify the job to be put in the background by giving its job
number as an argument.
NOTE: Running a job in the background is sometimes called backgrounding or amping off a job.
To move a specific job to the foreground when you have multiple jobs in the background, specify the
job number as an option to fg.
This example shows two jobsapropos shell > shell-commands and apropos bash >
bash-commands. The + character next to a job number indicates that its the most recent job, and
the - character indicates that its the job previous to the most recent job. If you have no current jobs,
jobs returns nothing.
To list all of the processes you have running on the system, use ps instead of jobssee Section 2.7
[Listing System Activity], page 25.
$ cat RET
C-c RET
$
Use kill to interrupt (kill) a background job, specifying the job number as an argument.
To kill job number 2, type:
$ kill %2 RET
$
1
2
3
4
$
history RET
who
apropos shell >shell-commands
apropos bash >bash-commands
history
This command shows the contents of your command history file, listing one command per line prefaced by its event number. Use an event number to specify that event in your history (see Section 3.4.2
[Specifying a Command from Your History], page 41).
If your history is a long one, this list will scroll off the screen, in which case you may want to pipe the
output to less in order to peruse it. Its also common to search for a past command by piping the output
to grep (see Section 3.2.4 [Redirecting Output to Another Commands Input], page 37 and Section 14.1
[Searching for a Word or Phrase], page 147).
To search your history for the text apropos, type:
$
2
3
5
$
history
apropos
apropos
history
This command will show the events from your history containing the text apropos. (The last line
of output is the command you just typed.)
To run a history event by its event number, enter an exclamation point (!, sometimes called bang)
followed by the event number. (Get the event number by viewing your history; see Section 3.4.1 [Viewing
Your Command History], page 40).
To run history event number 1, type:
$ !1 RET
In this example, the typescript records a shell session consisting of two commands (hostname and
apropos) to a file called log.19990817. The typescript looks like this:
Script started on Tue May 25 14:21:52 1999
$ hostname
erie
$ apropos bash > bash.commands
$ exit
exit
Script done on Tue May 25 14:22:30 1999
NOTE: Its possible, but usually not desirable, to run script from within another script session.
This usually happens when youve forgotten that you are running it, and you run it again inside the
current typescript, even multiple timesas a result, you may end up with multiple sessions nested
inside each other like a set of Russian dolls.
RET
Since the replacement text has spaces in it, weve quoted it (see Section 3.1.1 [Passing Special Characters to Commands], page 34).
You can put special characters in the prompt variable in order to output special text. For example,
the characters \w in the value of PS1 will list the current working directory at that place in the shell
prompt text.
To change your prompt to the default bash promptthe current working directory followed by a
$ charactertype:
$ PS1=\w $
$
RET
The following table lists some special characters and their text output at the shell prompt.
T EXT O UTPUT
S PECIAL C HARACTER
\a
Inserts a C-g character, which makes the internal speaker beep. (It
rings the system bell; C-g is sometimes called the bell character.)
\d
\h
\n
A newline character.
\t
\@
\w
\u
Your username.
This command makes bye an alias for exit in the current shell, so typing bye would then run
exit.
You can also include options and arguments in an alias.
To make an alias of ap for the command apropos shell bash shells, type:
$ alias ap="apropos shell bash shells" RET
This command makes ap an alias for apropos shell bash shells in the current shell, so
typing ap would run apropos shell bash shells.
For all new shells after youve logged in (that is, all but the login shell), bash reads and executes
the commands in the .bashrc file in your home directory. Commands in this file run whenever a new
shell is started except for the login shell.
There are separate configuration files for login and all other shells so that you can put specific customizations in your .bash_profile that only run when you first log in to the system. To avoid
having to put commands in both files when you want to run the same ones for all shells, append the
following to the end of your .bash_profile file:
if [ -f /.bashrc ]; then . /.bashrc; fi
This makes bash run the .bashrc file in your home directory when you log in. In this way, you
can put all of your customizations in your .bashrc file, and they will be run both at log in and for all
subsequent shells. Any customizations before this line in .bash_profile run only when you log
in.
For example, a simple .bash_profile might look like this:
# "Comment" lines in shell scripts begin with a # character.
# They are not executed by bash, but exist so that you may
# document your file.
# You can insert blank lines in your file to increase readability;
# bash will not mind.
# Generate a welcome message when you log in.
figlet Good day, $USER!
# Now run the commands in .bashrc
if [ -f /.bashrc ]; then . /.bashrc; fi
This .bash_profile prints a welcome message with the figlet text font tool (see Section 16.3.1 [Horizonal Text Fonts], page 178), and then runs the commands in the .bashrc file.
A simple .bashrc file might look like this:
# Make color directory listings the default.
alias ls="ls --color=auto"
# Make "l" give a verbose directory listing.
alias l="ls -l"
# Set a custom path.
PATH="/usr/local/bin:/usr/bin:/bin:/usr/bin/X11:/usr/games:/bin:."
# Set a custom shell prompt.
PS1="[\w] $ "
# Make a long history list and history file.
HISTSIZE=20000
HISTFILESIZE=20000
# Export the path and prompt variables for all
# variables you define.
export HISTSIZE HISTFILESIZE PATH PS1
This .bashrc sets a few useful command aliases and uses a custom path and shell prompt whenever a new shell is run; with the preceding .bash_profile, this .bashrc is also run at login.
When you log out, bash reads and executes the commands in the .bash_logout file in your
home directory, if it exists. To run commands when you log out, put them in this file.
To clear the screen every time you log out, your .bash_logout would contain the following
line:
clear
This executes the clear command, which clears the screen of the current terminal, such as in the
xterm window where you type it, or in a virtual console.
NOTE: Some distributions come with default shell startup files filled with all kinds of
interesting stuff.
Debian users might want to look at the example startup files in
/usr/share/doc/bash/examples/startup-files.
4.1 Running X
WWW: http://www.afterstep.org/
WWW: http://www.fvwm.org/
WWW: http://www.windowmaker.org/
WWW: http://www.gnome.org/
WWW: http://www.kde.org/
When you start X, you should see a mouse pointer appear on the screen as a large, black X. If your X
is configured to start any tools or applications, they should each start and appear in individual windows.
A typical X session looks like this:
The root window is the background behind all of the other windows. It is usually set to a color, but
you can change it (see Section 4.6.3 [Changing the Root Window Parameters], page 55). Each program
or application in X runs in its own window. Each window has a decorative border on all four sides,
Sometimes you might see it referred to as X Windows, but this term is incorrect.
called the window border ; L-shaped corners, called frames ; a top window bar, called the title bar, which
displays the name of the window; and several title bar buttons on the left and right sides of the title bar
(described in Section 4.3 [Manipulating X Client Windows], page 52).
The entire visible work area, including the root window and any other windows, is called the desktop.
The box in the lower right-hand corner, called the pager, allows you to move about a large desktop (see
Section 4.4 [Moving around the Desktop], page 53).
A window manager controls the way windows look and are displayedthe window dressing, as it
wereand can provide some additional menu or program management capabilities. There are many
different window managers to choose from, with a variety of features and capabilities. (See Section 4.6.4
[Choosing a Window Manager], page 56, for help in choosing a window manager thats right for you.)
Window managers typically allow you to customize the colors and borders that are used to display a
window, as well as the type and location of buttons that appear on the window (see Section 4.2 [Running
a Program in X], page 49). For example, in the image above, the clock image itself is the oclock
program; the blue outline around it is the window border, as drawn by the fvwm2 window manager.
With the afterstep window manager, the window border would look quite different:
There are many window managers you can choose from, all different; instead of describing only one,
or describing all of them only superficially, this chapter shows the basics of X, which are common to all
window managers. I try to make no assumptions as to which window manager you are using; while the
fvwm family of window managers has long been a popular choice on most Linux-based systems, today
other window managersincluding WindowMaker (the binary itself is called wmaker), Enlightenment,
AfterStep, and othershave all gained in popularity.
And recently, desktop environments have become popular. These are a collection of applications that
run on top of the window manager (and X), with the purpose of giving your X session a standardized
look and feel; these suites normally come with a few basic tools such as clocks and file managers. The
two popular ones are GNOME and KDE, and while they generate a lot of press these days because of
their graphical nature, both are changing very quickly and at the time of this writing are not yet ready for
widespread, general use (and they can cause your system to crash).
If you have a recent Linux distribution and chose the default install, chances are good that you have
either GNOME or KDE installed, with either the fvwm2 or wmaker window manager assigned as the
default. (While you can have more than one window manager installed on your system, you can only run
one at a time.)
4.1.1 Starting X
There are two ways to start X. Some systems run the X Display Manager, xdm, when the system boots, at
which point a graphical xdm login screen appears; you can use this to log in directly to an X session. On
systems not running xdm, the virtual console reserved for X will be blank until you start X by running
the startx command.
To start X from a virtual console, type:
$ startx RET
To run startx and redirect its output to a log file, type:
$ startx >$HOME/startx.log 2>&1 RET
Both of these examples start X on the seventh virtual console, regardless of which console you are
at when you run the commandyour console switches to X automatically. You can always switch to
another console during your X session (see Section 2.3 [Console Basics], page 20). The second example
writes any error messages or output of startx to a file called startx.log in your home directory.
On some systems, X starts with 8-bit color depth by default. Use startx with the special -bpp
option to specify the color depth. Follow the option with a number indicating the color depth to use, and
precede the option with two hyphen characters (--), which tells startx to pass the options which
follow it to the X server itself.
To start X from a virtual console, and specify 16-bit color depth, type:
$ startx -- -bpp 16 RET
NOTE: If your system runs xdm, you can always switch to the seventh virtual console (or whichever
console xdm is running on), and then log in at the xdm login screen.
4.1.2 Stopping X
To end an X session, you normally choose an exit X option from a menu in your window manager.
To end your X session if you are running the fvwm2 window manager, click the left mouse button in
the root window to pull up the start menu, and then choose Really quit? from the Exit Fvwm
submenu.
To end your X session if you are running the afterstep window manager, click the left mouse
button in the root window to pull up the start menu, and then choose Really quit? from the
Exit Fvwm submenu.
If you started your X session with startx, these commands will return you to a shell prompt in
the virtual console where the command was typed. If, on the other hand, you started your X session by
logging in to xdm on the seventh virtual console, you will be logged out of the X session and the xdm
login screen will appear; you can then switch to another virtual console or log in to X again.
To exit X immediately and terminate all X processes, press the CTRL-ALT-BKSP combination (if
your keyboard has two ALT and CTRL keys, press the left ones). Youll lose any unsaved application
data, but this is useful when you cannot exit your X session normallyin the case of a system freeze or
other problem.
To exit X immediately, type:
CTRL-ALT-BKSP
menus and on Xclock (analog). This starts the xclock client, specifying the option to display
an analog face:
You can also start a client by running it from a shell windowuseful for starting a client that isnt on
the menu, or for when you want to specify options or arguments. When you run an X client from a shell
window, it opens in its own window; run the client in the background to free the shell prompt in the shell
window (see Section 3.3.2 [Putting a Job in the Background], page 38).
To run a digital clock from a shell window, type:
$ xclock -digital & RET
This command runs xclock in the background from a shell window; the digital option specifies a digital clock.
The following sections explain how to specify certain command-line options common to most X
clientssuch as window layout, colors, and fonts.
You can give positive or negative numbers for the XOFF and YOFF fields. Positive XOFF values
specify a position from the left of the screen; negative values specify a position from the right. If YOFF
is positive, it specifies a position from the top of the screen; if negative, it specifies a position from the
bottom of the screen. When giving these offsets, you must specify values for both XOFF and YOFF.
To place the window in one of the four corners of the desktop, use zeroes for the appropriate XOFF
and YOFF values, as follows:
XOFF AND YOFF VALUES
+0+0
W INDOW P OSITION
Upper left corner.
+0-0
-0+0
-0-0
RET
Or, to put it all together, you can specify the size and location of a window with one geometry line
that includes all four values.
To start an xclock with a width of 120 pixels, a height of 100 pixels, an x offset of 250 pixels from
the right side of the screen, and a y offset of 25 pixels from the top of the screen, type:
$ xclock -geometry 120x100-250+25
RET
RET
RET
RET
To start an xclock with a digital display, and specify that it use a 17-point Helvetica font for text,
type:
$ xclock -digital -fn -*-helvetica-*-r-*-*-17-*-*-*-*-*-*-*
RET
NOTE: If you specify the font for a shell window, you can resize it after its running, as described in
Section 16.1.4 [Resizing the Xterm Font], page 177.
-bw number
-borderwidth number
-fg color
-foreground color
-fn font
-font font
-geometry geometry
-iconic
-title string
In the preceding illustration, the current desktop is the second one in the top row. The first desktop
contains two X client windowsa small one and a large onebut there are no windows in any other
desktop (including the current one).
To switch to another desktop, click the left mouse button on its corresponding view in the pager, or use
a keyboard shortcut. In fvwm2, the default keys for switching between desktops areALT in conjunction
with the arrow keys; in afterstep, use the CTRL key in place of ALT.
To switch to the desktop to the left of the current one while running fvw2, type ALT-.
To switch to the desktop directly to the left of the current one while running afterstep, type
CTRL-.
4.6 Configuring X
There are some aspects of X that people usually want to configure right away. This section discusses some
of the most popular, including changing the video mode, automatically running clients at startup, and
choosing a window manager. Youll find more information on this subject in both The X Window User
HOWTO and The Configuration HOWTO (for how to read them, see Section 2.8.6 [Reading System
Documentation and Help Files], page 31).
Type either of the above key combinations repeatedly to cycle through all available modes.
NOTE: For more information on video modes, see The XFree86 Video Timings HOWTO (see Section 2.8.6 [Reading System Documentation and Help Files], page 31).
To change the root window pattern, use the -bitmap option, and give the name of the bitmap file
to use.
To tile the root window with a star pattern, type:
$ xsetroot -bitmap /usr/X11R6/include/bitmaps/star RET
When specifying a pattern, use the -fg and -bg options to specify the foreground and background colors.
To tile the root window with a light slate gray star pattern on a black background, type (all on one
line):
$ xsetroot -fg slategray2 -bg black -bitmap
/usr/X11R6/include/bitmaps/star RET
Use xsetroot with the special -gray option to change the root window to a shade of gray
designed to be easy on the eyes, with no pattern.
To make the root window a gray color with no pattern, type:
$ xsetroot -gray
RET
NOTE: You can also put an image in the window (although this consumes memory that could be spared
for a memory-hogging Web browser instead; but see Section 17.2.2 [Putting an Image in the Root Window], page 186, for how to do it).
enlightenment
Enlightenment is a graphics-intensive window manager that uses desktop themes for decorating the various controls of the X session.
Debian: enlightenment
WWW: http://www.enlightenment.org/
fvwm95
twm
wm2
To represent a directorys place in the file hierarchy, specify all of the directories between it and the
root directory, using a slash (/) as the delimiter to separate directories. So the directory dict as it
appears in the preceding illustration would be represented as /usr/dict.
Each user has a branch in the /home directory for their own files, called their home directory. The
hierarchy in the previous illustration has two home directories: joe and jon, both subdirectories of
/home.
When you are in a shell, you are always in a directory on the system, and that directory is called
the current working directory. When you first log in to the system, your home directory is the current
working directory.
Whenever specifying a file name as an argument to a tool or application, you can give the slashdelimited path name relative to the current working directory. For example, if /home/joe is
the current working directory, you can use work to specify the directory /home/joe/work, and
work/schedule to specify schedule, a file in the /home/joe/work directory.
Every directory has two special files whose names consist of one and two periods: .. refers to
the parent of the current working directory, and . refers to the current working directory itself. If
the current working directory is /home/joe, you can use . to specify /home/joe and .. to
specify /home. Furthermore, you can specify the /home/jon directory as ../jon.
Another way to specify a file name is to specify a slash-delimited list of all of the directory branches
from the root directory (/) down to the file to specify. This unique, specific path from the root directory
to a file is called the files full path name. (When referring to a file that is not a directory, this is sometimes
called the absolute file name ).
You can specify any file or directory on the system by giving its full path name. A file can have the
same name as other files in different directories on the system, but no two files or directories can share
a full path name. For example, user joe can have a file schedule in his /home/joe/work
directory and a file schedule in his /home/joe/play directory. While both files have the same
name (schedule), they are contained in different directories, and each has a unique full path name
/home/joe/work/schedule and /home/joe/play/schedule.
However, you dont have to type the full path name of a tool or application in order to start it. The
shell keeps a list of directories, called the path, where it searches for programs. If a program is in your
path, or in one of these directories, you can run it simply by typing its name.
By default, the path includes /bin and /usr/bin. For example, the who command is in the
/usr/bin directory, so its full path name is /usr/bin/who. Since the /usr/bin directory is
in the path, you can type who to run /usr/bin/who, no matter what the current working directory is.
The following table describes some of the standard directories on Linux systems.
D IRECTORY
D ESCRIPTION
/
The ancestor of all directories on the system; all other directories are
subdirectories of this directory, either directly or through other subdirectories.
/bin
/dev
/etc
/home
/lib
/proc
/root
/sbin
/tmp
Temporary files.
/usr
/usr/X11R6
/usr/bin
/usr/dict
/usr/doc
/usr/games
/usr/info
/usr/lib
lists
(slowly
being
outmoded
by
/usr/local
Local filesfiles unique to the individual systemincluding local documentation (in /usr/local/doc) and programs (in
/usr/local/bin).
/usr/man
The online manuals, which are read with the man command (see Section 2.8.4 [Reading a Page from the System Manual], page 28).
/usr/share
/usr/src
/usr/tmp
/var
NOTE: For more information on the directory structure of Linux-based systems, view the compressed
files in the /usr/doc/debian-policy/fsstnd/ directory (see Section 9.1 [Perusing Text],
page 99).
.ltx or .latex
Text formatted in the LaTeX formatting language (neither are as common as just using .tex).
.gz
A compressed file.
.sgml
.html
.xml
XML (Extended Markup Language) format.
The following sections show how to make new files; to rename an existing file, move it to a file with
the new namesee Section 5.5 [Moving Files and Directories], page 68.
Technically, there are other characters that you can usebut doing so may get you into trouble later on.
This tool touches the files you give as arguments. If a file does not exist, it creates it; if the file
already exists, it changes the modification timestamp on the file to the current date and time, just as if
you had used the file.
NOTE: Often, you make a file when you edit it, such as when in a text or image or sound editor; in that
case, you dont need to make the file first.
This makes a 2001 subdirectory in the directory called completed, which in turn is in a directory called work in the current directory; if the completed or the work directories do not
already exist, they are made as well (if you know that work and completed both exist, the above
command works fine without the -p option).
$ pwd RET
/home/mrs
$
In this example, pwd output the text /home/mrs, indicating that the current working directory is
/home/mrs.
$ ls RET
apple
cherry
$
orange
In this example, the current working directory contains three files: apple, cherry, and
orange.
To list the contents of work, a subdirectory in the current directory, type:
$ ls work RET
To list the contents of the /usr/doc directory, type:
$ ls /usr/doc
RET
You cannot discern file types from the default listing; directories and executables are indistinguishable
from all other files. Using the -F option, however, tells ls to place a / character after the names of
subdirectories and a * character after the names of executable files.
To list the contents of the directory so that directories and executables are distinguished from other
files, type:
$ ls -F RET
repeat* test1
$
test2
words/
In this example, the current directory contains an executable file named repeat, a directory named
words, and some other files named test1 and test2.
Another way to list the contents of directoriesand one I use all the time, when Im in X and when
I also want to look at image files in those directoriesis to use Mozilla or some other Web browser
as a local file browser. Use the prefix file:/ to view local files. Alone, it opens a directory listing of the root directory; file:/home/joe opens a directory listing of user joes home directory,
file:/usr/local/src opens the local source code directory, and so on. Directory listings will be
rendered in HTML on the fly in almost all browsers, so you can click on subdirectories to traverse to
them, and click on files to open them in the browser.
Yet another way to list the contents of directories is to use a file manager tool, of which there are at
least a few on Linux; the most popular of these is probably the Midnight Commander, or mc.
The following subsections describe some commonly used options for controlling which files ls lists
and what information about those files ls outputs. It is one of the most often used file commands on
Unix-like systems.
$ ls -l /usr/doc/bash
total 72
-rw-r--r-1 root
-rw-r--r-1 root
-rw-r--r-1 root
-rw-r--r-1 root
-rw-r--r-1 root
-rw-r--r-1 root
-rw-r--r-1 root
-rw-r--r-1 root
-rw-r--r-1 root
drwxr-xr-x
9 root
$
RET
root
root
root
root
root
root
root
root
root
root
13744
1816
16398
2928
4751
1588
2718
19596
1446
1024
Oct
Oct
Oct
Oct
Oct
Oct
Oct
Oct
Oct
Jul
19
19
19
19
19
19
19
19
19
25
22:57
22:57
22:57
22:57
22:57
22:57
22:57
22:57
22:57
1997
CHANGES.gz
COMPAT.gz
FAQ.gz
INTRO.gz
NEWS.gz
POSIX.NOTES.gz
README.Debian.gz
changelog.gz
copyright
examples
This command outputs a verbose listing of the files in /usr/doc/bash. The first line of output
gives the total amount of disk space, in 1024-byte blocks, that the files take up (in this example, 72).
Each subsequent line displays several columns of information about one file.
The first column displays the files type and permissions. The first character in this column specifies
the file type; the hyphen (-) is the default and means that the file is a regular file. Directories are denoted
by d, and symbolic links (see Section 5.7 [Giving a File More than One Name], page 71) are denoted
by l. The remaining nine characters of the first column show the file permissions (see Section 6.3
[Controlling Access to Files], page 76). The second column lists the number of hard links to the file. The
third and fourth columns give the names of the user and group that the file belongs to. The fifth column
gives the size of the file in bytes, the sixth column gives the date and time of last modification, and the
last column gives the file name.
$ ls -R RET
play
work
play:
notes
work:
notes
$
In this example, the current working directory contains two subdirectories, work and play, and
no other files. Each subdirectory contains a file called notes.
To list all of the files on the system, type:
$ ls -R / RET
This command recursively lists the contents of the root directory, /, and all of its subdirectories. It
is common to combine this with the attribute option, -l, to output a verbose listing of all the files on
the system:
$ ls -lR / RET
NOTE: You cant list the contents of some directories on the system if you dont have permission to do
so (see Section 6.3 [Controlling Access to Files], page 76).
period; these are called dot files, or sometimes hidden files. As mentioned earlier, every directory has
two special dot files: .., the parent directory, and ., the directory itself.
To list all contents of a directory, including these dot files, use the -a option.
RET
Use the -A option to list almost all files in the directory: it lists all files, including dot files, with the
exception of .. and ..
To list all files in the current directory except for .. and ., type:
$ ls -A
RET
To
list the files in the root directory in color, type:
NOTE: Its common practice to create a command alias that substitutes ls --color for ls, so that
typing just ls outputs a color listing. To learn more about making aliases, see Section 3.6.2 [Making a
Command Alias], page 43.
To output a tree graph of the current directory and all its subdirectories, type:
$ tree RET
.
|-- projects
|
|-- current
|
-- old
|
|-- 1
|
-- 2
-- trip
-- schedule.txt
4 directories, 3 files
$
In the preceding example, a tree graph is drawn showing the current directory, which contains the
two directories projects and trip; the projects directory in turn contains the directories
current and old.
To output a tree graph of a specific directory tree, give the name of that directory tree as an argument.
To output a tree graph of your home directory and all its subdirectories, type:
$ tree RET
To output a graph of a directory tree containing directory names only, use the -d option. This is
useful for outputting a directory tree of the entire system, or for getting a picture of a particular directory
tree.
To output a tree graph of the entire system to the file tree, type:
$ tree -d / > tree RET
To peruse a tree graph of the /usr/local directory tree, type:
$ tree -d /usr/local |less RET
NOTE: Another tool for outputting directory trees is described in Section 24.2 [Listing a Files Disk
Usage], page 233.
-a
-d
-f
Do not sort directory contents; list them in the order they are written
on the disk.
-l
-r
-s
-t
NOTE: You can combine any of these options; for example, to list the contents of a directory sorted
newest first, and display all attributes, use -lt. To recursively list all hidden files and display all
attributes, use -lRa. It doesnt matter what order you put the options inso -lRa is the same as,
say, -alR.
This command creates a new file called neighbor-copy that is identical to my-copy in every
respect except for its name, owner, group, and timestampthe new file has a timestamp that shows the
time when it was copied. The file my-copy is not altered.
Use the -p (preserve) option to preserve all attributes of the original file, including its timestamp,
owner, group, and permissions.
To copy the file my-copy to the file neighbor-copy, preserving all of the attributes of the
source file in the target file, type:
$ cp -p my-copy neighbor-copy RET
This command copies the file my-copy to a new file called neighbor-copy that is identical
to my-copy in every respect except for its name.
To copy a directory along with the files and subdirectories it contains, use the -R optionit makes a
recursive copy of the specified directory and its entire contents.
To copy the directory public_html, and all of its files and subdirectories, to a new directory
called private_html, type:
$ cp -R public_html private_html RET
The -R option does not copy files that are symbolic links (see Section 5.7 [Giving a File More than
One Name], page 71), and it does not retain all original permissions. To recursively copy a directory
including links, and retain all of its permissions, use the -a (archive) option. This is useful for
making a backup copy of a large directory tree.
To make an archive copy of the directory tree public_html to the directory private_html,
type:
$ cp -a public_html private_html RET
This command moves the file notes in the current directory to play, a subdirectory of the
current working directorys parent. If a file notes already exists in play, that file is overwritten.
If the subdirectory play does not exist, this command moves notes to its parent directory and
renames it play.
To move a file or directory that is not in the current directory, give its full path name as an argument.
This command moves the file /usr/tmp/notes to the current working directory.
To move a directory, give the path name of the directory you want to move and the path name to move
it to as arguments.
To move the directory work in the current working directory to play, type:
$ mv work play RET
This command moves the directory work in the current directory to the directory play. If the
directory play already exists, mv puts work inside playit does not overwrite directories.
Renaming a file is the same as moving it; just specify as arguments the file to rename followed by the
new file name.
To rename the file notes to notes.old, type:
$ mv notes notes.old RET
By default, chcase does not rename directories; use the -d option to rename directories as well
as other files. The -r option recursively descends into any subdirectories and renames those files, too.
To change all of the files and subdirectory names in the current directory to all lowercase letters,
type:
$ chcase -d * RET
To change all of the files and subdirectory names in the current directory to all uppercase letters,
and descend recursively into all subdirectories, type:
$ chcase -d -r -u * RET
To change all of the files in the current directory to all lowercase letters, and descend recursively
into all subdirectories (but do not change any directory names), type:
$ chcase -r * RET
To rename all of the files in the current directory with a .htm extension to .html, type:
$ chcase -x s/htm/html/ *.htm RET
By default, chcase will not overwrite files; so if you want to rename index.htm to
index.html, and both files already exist in the current directory, the above example will do nothing.
Use the -o option to specify that existing files may be overwritten.
To rename all of the files in the current directory with a .htm extension to .html and overwrite
any existing files, type:
$ chcase -o -x s/htm/html/ *.htm RET
To remove a directory and all of the files and subdirectories it contains, use the -R (recursive)
option.
To remove the directory waste and all of its contents, type:
$ rm -R waste RET
To remove an empty directory, use rmdir; it removes the empty directories you specify. If you
specify a directory that contains files or subdirectories, rmdir reports an error.
To remove the directory empty, type:
$ rmdir empty RET
In the above example, after TAB was typed, the shell filled in the rest of the file name ( Way).
When a file name begins with a control character or other strange character, specify the file name
with a file name pattern that uniquely identifies it (see Section 5.8 [Specifying File Names with Patterns],
page 72, for tips on building file name patterns). Use the -i option to verify the deletion.
To delete the file Acat in a directory that also contains the files cat and dog, type:
$ rm -i ?cat RET
rm: remove Acat? y
$
RET
In the above example, the expansion pattern ?cat matches the file Acat and no other files in
the directory. The -i option was used because, in some cases, no unique pattern can be made for a
filefor example, if this directory also contained a file called 1cat, the above rm command would
also attempt to remove it; with the -i option, you can answer n to it.
These first two methods will not work with files that begin with a hyphen character, because rm will
interpret such a file name as an option; to remove such a file, use the -- optionit specifies that what
follows are arguments and not options.
To remove the file -cat from the current directory, type:
$ rm -- -cat RET
This command makes a hard link from an existing file, seattle, to a new file, emerald-city.
You can read and edit file emerald-city just as you would seattle; any changes you
make to emerald-city are also written to seattle (and vice versa). If you remove the file
emerald-city, file seattle is also removed.
To create a symlink instead of a hard link, use the -s option.
To create a symbolic link from seattle to emerald-city, type:
$ ln -s seattle emerald-city
RET
After running this command, you can read and edit emerald-city; any changes you make
to emerald-city will be written to seattle (and vice versa). But if you remove the file
emerald-city, the file seattle will not be removed.
[list ]
The tilde character expands to your home directory. For example, if your username is joe and therefore your home directory is
/home/joe, then expands to /home/joe. You can follow
the tilde with a path to specify a file in your home directoryfor example, /work expands to /home/joe/work.
Brackets also have special meaning when used in conjunction with other characters, as described by
the following table.
D ESCRIPTION
C HARACTER
A hyphen as part of a bracketed list denotes a range of characters
to matchso [a-m] matches any of the lowercase letters from a
through m. To match a literal hyphen character, use it as the first
or last character in the list. For example, a[-b]c matches the files
a-c and abc.
For more about using lynx, see Section 31.3 [Reading Text from the Web], page 288.
With Mozilla and some other browsers you must precede the full path name with the file:/
URNso the /usr/doc directory would be file://usr/doc. With lynx, just give a local
path name as an argument.
To browse the system documentation files in the /usr/doc directory in Mozilla, type the following in Mozillas Location window:
file://usr/doc
6 Sharing Files
Groups, file ownership, and access permissions are Linux features that enable users to share files with
one another. But even if you dont plan on sharing files with other users on your system, familiarity with
these concepts will help you understand how file access and security work in Linux.
$ groups RET
steward galley crew
$
In this example, three groups are output: steward (the users login group), galley, and crew.
To list the group memberships of user blackbeard, type:
In this example, the command outputs the given username, blackbeard, followed by the name
of one group, blackbeard, indicating that user blackbeard belongs to only one group: his login
group.
In this example, three usernames are output, indicating that these three users are the members of the
galley group.
This command transfers group ownership of cruise to bridge; the files group access permissions (see Section 6.3 [Controlling Access to Files], page 76) now apply to the members of the bridge
group.
Use the -R option to recursively change the group ownership of directories and all of their contents.
To give group ownership of the maps directory and all the files it contains to the bridge group,
type:
$ chgrp -R bridge maps RET
Permissions work differently for directories than for other kinds of files. Read permission for a
directory means that you can see the files in the directory; write permission lets you create, move, or
remove files in the directory; and execute permission lets you use the directory name in a path (see
Chapter 5 [Files and Directories], page 59).
If you have read permission but not execute permission for a directory, you can only read the names
of files in that directoryyou cant read their other attributes, examine their contents, write to them, or
execute them. With execute but not read permission for a directory, you can read, write to, or execute
any file in the directory, provided that you know its name and that you have the appropriate permissions
for that file.
Each file has separate permissions for three categories of users: the user who owns the file, all other
members of the group that owns the file, and all other users on the system. If you are a member of the
group that owns a file, the files group permissions apply to you (unless you are the owner of the file, in
which case the user permissions apply to you).
When you create a new file, it has a default set of permissionsusually read and write for the user,
and read for the group and all other users. (On some systems, the default permissions are read and write
for both the user and group, and read for all other users.)
The file access permissions for a file are collectively called its access mode. The following sections
describe how to list and change file access modes, including how to set the most commonly used access
modes.
NOTE: The superuser, root, can always access any file on the system, regardless of its access permissions.
See Info file fileutils.info, node File permissions, for more information on file permissions and access modes.
Make these the only permissions the user has for this file.
Finally, specify the permissions themselves:
P ERMISSION
C HARACTER
r
Set read permission.
=
To give execute permission to all users for the file myscript, type:
$ chmod a+x myscript RET
NOTE: Often, shell scripts that you obtain or write yourself do not have execute permission set, and
youll have to do this yourself.
7 Finding Files
Sometimes you will need to find files on the system that match given criteria, such as name and file size.
This chapter will show you how to find a file when you know only part of the file name, and how to find
a file whose name matches a given pattern. You will also learn how to list files and directories by their
size and to find the locations of commands.
NOTE: When you want to find files in a directory whose contents match a particular pattern, search
through the files with grepsee Chapter 14 [Searching Text], page 147. A method of searching for a
given pattern in the contents of files in different directories is given in Section 7.2.5 [Running Commands
on the Files You Find], page 84.
See Info file find.info, node Top, for more information on finding files.
This command will search all directories on the system to which you have access; if you dont have
execute permission for a directory, find will report that permission is denied to search the directory.
The -name option is case sensitive; use the similar -iname option to find name regardless of
case.
To list all files on the system whose file name is top, regardless of case, type:
$ find / -iname top RET
This command would match any files whose name consisted of the letters top, regardless of case
including Top, top, and TOP.
Use file expansion characters (see Section 5.8 [Specifying File Names with Patterns], page 72) to find
files whose names match a pattern. Give these file name patterns between single quotes.
To list all files on the system whose names begin with the characters top, type:
$ find / -name top* RET
To list all files whose names begin with the three characters top followed by exactly three more
characters, type:
$ find / -name top??? RET
To list all files whose names begin with the three characters top followed by five or more characters, type:
$ find / -name top?????* RET
To list all files in your home directory tree that end in .tex, regardless of case, type:
$ find -iname *.tex RET
To list all files in the /usr/share directory tree with the text farm somewhere in their name,
type:
$ find /usr/share -name *farm* RET
Use -regex in place of -name to search for files whose names match a regular expression, or
a pattern describing a set of strings (see Section 14.2 [Regular ExpressionsMatching Text Patterns],
page 148).
To list all files in the current directory tree whose names have either the string net or comm
anywhere in their file names, type:
$ find . -regex .*\(net\|comm\).* RET
NOTE: The -regex option matches the whole path name, relative to the directory tree you specify,
and not just file names.
Use the -empty option to find empty filesfiles whose size is 0 bytes. This is useful for finding
files that you might not need, and can remove.
To find all empty files in your home directory tree, type:
$ find -empty RET
NOTE: To find the largest or smallest files in a given directory, output a sorted listing of that directory
(see Section 7.3 [Finding Files in Directory Listings], page 86).
To specify a range of time, precede the number you give with either a plus sign (+) to match times
that are equal to or greater than the given argument, or a hyphen or minus sign (-) to match times that
are equal to or less than the given argument.
To list the files in the /usr/local directory tree that were modified within the past 24 hours,
type:
$ find /usr/local -mtime -1 RET
To list the files in the /usr directory tree that were modified within the past five minutes, type:
$ find /usr -mmin -5 RET
Include the -daystart option to measure time from the beginning of the current day instead of
24 hours ago.
To list all of the files in your home directory tree that were modified yesterday, type:
$ find -mtime 1 -daystart RET
To list all of the files in the /usr directory tree that were modified one year or longer ago, type:
$ find /usr -mtime +356 -daystart RET
To list all of the files in your home directory tree that were modified from two to four days ago,
type:
$ find -mtime 2 -mtime -4 -daystart RET
In the preceding example, the combined options -mtime 2 and -mtime -4 matched files that
were modified between two and four days ago.
To find files newer than a given file, give the name of that file as an argument to the -newer option.
To find files in the /etc directory tree that are newer than the file /etc/motd, type:
$ find /etc -newer /etc/motd RET
To find files newer than a given date, use the trick described in the find Info documentation: create
a temporary file in /tmp with touch whose timestamp is set to the date you want to search for, and
then specify that temporary file as the argument to -newer.
To list all files in your home directory tree that were modified after May 4 of the current year, type:
$ touch -t 05040000 /tmp/timestamp RET
$ find -newer /tmp/timestamp RET
In this example, a temporary file called /tmp/timestamp is written; after the search, you can
remove it (see Section 5.6 [Removing Files and Directories], page 70).
NOTE: You can also find files that were last accessed a number of days after they were modified by
giving that number as an argument to the -used option. This is useful for finding files that get little
usefiles matching -used +100, say, were accessed 100 or more days after they were last modified.
The -group option is similar, but it matches group ownership instead of user ownership.
To list all files in the /dev directory tree owned by the audio group, type:
$ find /dev -group audio RET
In this example, the command grep organic file is executed for each file that find finds, with
file being the name of each file in turn.
To have find pause and confirm execution for each file it finds, use -ok instead of -exec.
To remove files from your home directory tree that were accessed more than one year after they
were last modified, pausing to confirm before each removal, type:
$ find -used +365 -ok rm {} ; RET
The following tables describe many other options you can use with find. The first table lists and
describes finds general options for specifying its behavior. As you will see, find can take many
different options; see its man page or its info documentation for all of them.
D ESCRIPTION
O PTION
-daystart
Use the beginning of today rather than 24 hours previous for time criteria.
-depth
-help
-maxdepth levels
-mount or -xdev
-version
Output the version number and exit.
The following table lists and describes finds options for specifying which files to find.
Specify the numeric arguments to these options in one of three ways: preceded with a plus sign (+)
to match values equal to or greater than the given argument; preceded with a hyphen or minus sign (-)
to match values equal to or less than the given argument; or give the number alone to match exactly that
value.
O PTION
D ESCRIPTION
-amin minutes
Time in minutes since the file was last accessed.
-anewer file
-atime days
-cmin minutes
-cnewer file
-ctime days
-empty
File is empty.
-group group
-iname pattern
-ipath pattern
Full path name of file matches the pattern pattern, regardless of case (./r*rt matches ./records/report and
./Record-Labels/ART.
-iregex regexp
Path name of file, relative to specified directory tree, matches the regular expression regexp, regardless of case (t?p matches TIP and
top).
-links links
Number of links to the file (see Section 5.7 [Giving a File More than
One Name], page 71).
-mmin minutes
-mtime days
-name pattern
-newer file
-path pattern
Full path name of file matches the pattern pattern (./r*rt matches
./records/report).
Files permissions are exactly access mode (see Section 6.3 [Controlling Access to Files], page 76).
-regex regexp
Path name of file, relative to specified directory tree, matches the regular expression regexp.
-size size
File uses size space, in 512-byte blocks. Append size with b for
bytes or k for kilobytes.
-type type
File is type type, where type can be d for directory, f for regular
file, or l for symbolic link.
-user user
File is owned by user.
The following table lists and describes finds options for specifying what to do with the files it finds.
O PTION
D ESCRIPTION
-exec commands
-ok commands
Outputs the name of found files to the standard output, each followed
by a newline character so that each is displayed on a line of its own.
On by default.
-printf format
Use C-style output (the same as used by the printf function in the
C programming language), as specified by string format.
The following table describes the variables may be used in the format string used by the -printf
option.
VARIABLE
D ESCRIPTION
\a
Ring the system bell (called the alarm on older systems).
\b
\f
\n
\r
\t
\\
%%
%b
%f
%h
%k
%s
NOTE: Pipe the output to less to peruse it (see Section 9.1 [Perusing Text], page 99).
To list the files in the current directory and their attributes, sorted from smallest to largest, type:
$ ls -lSr RET
$ ls | wc -l
19
$
RET
In this example, the command outputs the text 19, indicating that there are 19 files in the current
directory.
Since ls does not list hidden files by default (see Section 5.3.4 [Listing Hidden Files], page 65), the
preceding command does not count them. Use lss -A option to count dot files as well.
To count the number of filesincluding dot filesin the current directory, type:
$ ls -A | wc -l
81
$
RET
This command outputs the text 81, indicating that there are 81 files, including hidden files, in the
current directory.
To list the number of files in a given directory tree, and not just a single directory, use find instead
of ls, giving the special find predicate \! -type d to exclude the listing (and therefore, counting)
of directories.
In this example, which output /usr/bin/perl, indicating that the perl binary is installed in
the /usr/bin directory.
NOTE: This is also useful for determining which binary would execute, should you type the name,
since some systems may have different binaries of the same file name located in different directories. In
that case, you can use which to find which one would execute.
8 Managing Files
File management tools include those for splitting, comparing, and compressing files, making backup
archives, and tracking file revisions. Other management tools exist for determining the contents of a file,
and for changing its timestamp.
This command reports that the file /usr/doc/HOWTO/README.gz contains data that has been
compressed with the gzip tool.
To determine the original format of the data in a compressed file, use the -z option.
To determine the format of the compressed data contained in the file
/usr/doc/HOWTO/README.gz, type:
To specify a timestamp other than the current system time, use the -d option, followed by the date
and time that should be used enclosed in quote characters. You can specify just the date, just the time, or
both.
NOTE: When only the date is given, the time is set to 0:00; when no year is given, the current year is
used.
See Info file fileutils.info, node Date input formats, for more information on date
input formats.
This command creates five new files whose names begin with large.mp3.. The first four files
are one megabyte in size, while the last file is 200,118 bytesthe remaining portion of the original file.
No alteration is made to large.mp3.
You could then copy these five files onto four floppies (the last file fits on a floppy with one of the
larger files), copy them all to your laptop, and then reconstruct the original file with cat (see Section 10.6
[Concatenating Text], page 116).
To reconstruct the original file from the split files, type:
$ cat large.mp3.* > large.mp3 RET
$ rm large.mp3.* RET
In this example, the rm tool is used to delete all of the split files after the original file has been
reconstructed.
RET
To compare two files and output a difference report, give their names as arguments to diff.
To compare the files manuscript.old and manuscript.new, type:
$ diff manuscript.old manuscript.new
RET
The difference report is output to standard output; to save it to a file, redirect the output to the file to
save to:
$ diff manuscript.old manuscript.new > manuscript.diff
RET
In the preceding example, the difference report is saved to a file called manuscript.diff.
The difference report is meant to be used with commands such as patch, in order to apply the
differences to a file. See Info file diff.info, node Top, for more information on diff and the
format of its output.
To better see the difference between two files, use sdiff instead of diff; instead of giving a
difference report, it outputs the files in two columns, side by side, separated by spaces. Lines that differ
in the files are separated by |; lines that appear only in the first file end with a <, and lines that appear
only in the second file are preceded with a >.
To peruse the files laurel and hardy side by side on the screen, with any differences indicated
between columns, type:
$ sdiff laurel hardy | less
RET
RET
To update the original file manuscript.new with the patchfile manuscript.diff, type:
$ patch manuscript.new manuscript.diff
RET
This command compresses the file war-and-peace, putting it in a new file named
war-and-peace.gz; gzip then deletes the original file, war-and-peace.
This command expands the file war-and-peace.gz and puts it in a new file called
war-and-peace; gunzip then deletes the compressed file, war-and-peace.gz.
NOTE: You can view a compressed text file without uncompressing it by using zless. This is useful
when you want to view a compressed file but do not want to write changes to it. (For more information
about zless, see Section 9.1 [Perusing Text], page 99).
This command creates an archive file called project.tar containing the project directory
and all of its contents. The original project directory remains unchanged.
Use the -z option to compress the archive as it is being written. This yields the same output as
creating an uncompressed archive and then using gzip to compress it, but it eliminates the extra step.
To create a compressed archive called project.tar.gz from the contents of the project
directory, type:
$ tar -zcvf project.tar.gz project RET
This command creates a compressed archive file, project.tar.gz, containing the project
directory and all of its contents. The original project directory remains unchanged.
NOTE: When you use the -z option, you should specify the archive name with a .tar.gz extension and not a .tar extension, so the file name shows that the archive is compressed. This is not a
requirement, but it serves as a reminder and is the standard practice.
This command lists the contents of the project.tar archive. Using the -v option along with
the -t option causes tar to output the permissions and modification time of each file, along with its
file namethe same format used by the ls command with the -l option (see Section 5.3.1 [Listing
File Attributes], page 64).
Include the -z option to list the contents of a compressed archive.
To list the contents of a compressed archive called project.tar.gz, type:
$ tar -ztvf project.tar RET
This command extracts the contents of the project.tar archive into the current directory.
If an archive is compressed, which usually means it will have a .tar.gz or .tgz extension,
include the -z option.
To extract the contents of a compressed archive called project.tar.gz, type:
$ tar -zxvf project.tar.gz RET
NOTE: If there are files or subdirectories in the current directory with the same name as any of those in
the archive, those files will be overwritten when the archive is extracted. If you dont know what files
are included in an archive, consider listing the contents of the archive first (see Section 8.6.2 [Listing the
Contents of an Archive], page 93).
Another reason to list the contents of an archive before extracting them is to determine whether the
files in the archive are contained in a directory. If not, and the current directory contains many unrelated
files, you might confuse them with the files extracted from the archive.
To extract the files into a directory of their own, make a new directory, move the archive to that
directory, and change to that directory, where you can then extract the files from the archive.
$ ci novel RET
novel,v <-- novel
enter description, terminated with single . or end of file:
NOTE: This is NOT the log message!
>> The Great American Novel. RET
>> . RET
$
This command deposits the file in an RCS repository file called novel,v, and the original file,
novel, is removed. To edit or access the file again, you must check out a revision of the file from RCS
with which to work (see Section 8.7.2 [Checking Out a File Revision], page 95).
Whenever you have a new revision that you want to save, use ci as before to check in the file. This
begins the process all over again.
For example, suppose you have checked out the first revision of novel and changed the file so that
it now looks like this:
This is a very long tale about a great many things, including my long
voyage across America, and back home again.
To deposit this revision in RCS, type:
$ ci novel RET
novel,v <-- novel
new revision: 1.2; previous revision: 1.1
enter log message, terminated with single . or end of file:
>> Second draft. RET
>> . RET
$
If you create a subdirectory called RCS (in all uppercase letters) in the current directory, RCS
recognizes this specially named directory instead of the current directory as the place to store the ,v
revision files. This helps reduce clutter in the directory you are working in.
If the file you are depositing is a text file, you can have RCS insert a line of text, every time the
file is checked out, containing the name of the file, the revision number, the date and time in the UTC
(Coordinated Universal Time) time zone, and the user ID of the author. To do this, put the text $Id$
at a place in the file where you want this text to be written. You only need to do this once; each time you
check the file out, RCS replaces this string in the file with the header text.
For example, this chapter was written to a file, managing-files.texinfo, whose revisions
were tracked with RCS; the $Id$ string in this file currently reads:
$Id: managing-files.texinfo,v 1.32 2001/05/16 16:57:58 m Exp m $
This command checks out the latest revision of file novel from the novel,v repository, writing
it to a file called novel in the current directory. (If a file with that name already exists in the current
directory, co asks whether or not to overwrite the file.) You can make changes to this file and then check
it in as a new revision (see Section 8.7.1 [Checking In a File Revision], page 94).
You can also check out a version of a file as read only, where changes cannot be written to it. Do this
to check out a version to view only and not to edit.
To check out the current version of a file for examination, type co followed by the name of the file.
To check out the current revision of file novel, but not permit changes to it, type:
$ co novel RET
This command checks out the latest revision of the file novel from the RCS repository novel,v
(either from the current directory or in a subdirectory named RCS).
To check out a version other than the most recent version, specify the version number to check out
with the -r option. Again, use the -l option to allow the revision to be edited.
To check out revision 1.14 of file novel, type:
$ co -l -r1.14 novel RET
NOTE: Before checking out an old revision of a file, remember to check in the latest changes first, or
they may be lost.
$ rlog novel
RET
This command outputs the revision log for the file novel; it lists information about the RCS
repository, including its name (novel,v) and the name of the actual file (novel). It also shows that
there are two revisionsthe first, which was checked in to RCS on 20 June 1991, and the second, which
was checked in to RCS the next day, on 21 June 1991.
9 Viewing Text
Dealing with textual matter is the meat of Linux (and of most computing), so there are going to be many
chapters about the various aspects of text. This first chapter in this part of the book shows how to view
text on your display screen.
There are many ways to view or otherwise output text. When your intention is to edit the text of a
file, open it in a text editor, as described in Chapter 10 [Text Editing], page 107.
Some kinds of filessuch as PostScript, DVI, and PDF filesoften contain text in them, but they
are technically not text files. These are image format files, and I describe methods for viewing them in
Section 17.1 [Previewing Print Files], page 183.
NOTE: To learn how to browse files and their contents in a Web browser, see Section 5.9 [Browsing
Files], page 73.
This command starts less and displays the file README on the screen.
You can more forward through the document a line at a time by typing , and you can move forward
through the document a screenful at a time by typing PgDn. To move backward by a line, type , and
type PgUp to move backward by a screenful.
You can also search through the text you are currently perusingthis is described in Section 14.7
[Searching Text in Less], page 155.
To stop viewing and exit less, press Q.
This command starts less, opens in it all of the files that match the given pattern
/usr/doc/FAQ/unix-faq-part*, and begins displaying the first one:
NOTE: When you specify more than one file to page, less displays each file in turn, beginning with
the first file you specify or the first file that matches the given pattern. To move to the next file, pressN;
to move to the previous file, press P.
C OMMAND
Scroll back through the text (up) one line.
or
PgUp
or
SPC
Scroll horizontally (left or right) one tab stop; useful for perusing files
that contain long lines.
Scroll forward through the text by one screenful.
PgDn
C-l
/pattern
?pattern
<
>
To peruse the file translation with non-printing characters displayed in hat notation, type:
$ cat -v translation | less RET
In this example, the output of cat is piped to less for viewing on the screen; you could have piped
it to another command, or redirected it to a file instead.
To visually display the end of each line, use the -E option; it specifies that a $ should be output
after the end of each line. This is useful for determining whether lines contain trailing space characters.
Also useful is the -T option, which outputs tab characters as I.
The -A option combines all three of these optionsit is the same as specifying -vET.
You can specify as a numeric option the number of lines to output. If you specify more lines than a
file contains, head just outputs the entire text.
To output a given number of characters instead of lines, give the number of characters to output as
an argument to the -c option.
RET
It is sometimes useful to view the end of a file on a continuing basis; this can be useful for a growing
file, a file that is being written to by another process. To keep viewing the end of such a file, use tail
with the -f (follow) option. Type C-c to stop viewing the file.
RET
NOTE: You can achieve the same result with less; to do this, type F while perusing the text (see
Section 9.1 [Perusing Text], page 99).
RET
To output a region of more than one line, give the starting and ending line numbers, separated by a
comma.
RET
You can also combine multiple head or tail commands on a pipeline to get the desired result (see
Section 3.2.4 [Redirecting Output to Another Commands Input], page 37).
RET
In the preceding example, three commands were used: the first five lines of the file
placement-list are passed to tail, which outputs the last line in the output (the fifth line in the
file); then, the last head command outputs the first character in that last line, which achieves the desired
result.
To output all of the lines of text except those between two patterns, omit the -n option.
To output all the text from file book-draft, except that which lies between the text Chapter
3 and Chapter 4, type:
$ sed /Chapter 3/,/Chapter 4/p book-draft RET
NOTE: For a more thorough introduction to sed, see Section 10.5 [Editing Streams of Text], page 116.
These commands pass the contents of the file /etc/motd to the kraut filter, whose output is
then sent to standard output. The contents of /etc/motd are not changed.
Some of the dialect filters available include nyc, which gives a New Yawker dialect to text, and
newspeak, which translates text into the approved language of the thought police, as described in
George Orwells novel, 1984. Hail Big Brother!
To start streaming the text, either press S once, or left-click on the button marked RSVP. Both S
and the RSVP button toggle the streaming; the left and right arrow keys control the speed.
Text being streamed with sview looks like this:
The large area with the word beginning in it is where the text is being streamed. The text in the
lower-left window is a shrunken view of the entire file, the text in the lower-right window is the paragraph
from which the current word comes from.
To open another file, choose it from the menu; you can have many files open in sview at once.
sview places each file in its own buffer. You can also paste the X selection into a buffer of its ownto
switch to a different buffer, choose its name from the Buffer menu.
Type Q to quit reading and exit sview.
The following table lists the keyboard commands used in sview and describes their meaning.
K EYSTROKE
D ESCRIPTION
Decrease the stream speed.
C-o
Open a file.
C-q
C-w
M-n
M-p
S
X
N
P
$ man ascii
RET
You can use the octal codes listed for each character to type them in Emacssee Section 10.2.5
[Inserting Special Characters in Emacs], page 113.
The default Linux character set, the ISO 8859-1 (Latin 1) character set, contains all of the standard
ASCII character set plus an additional 128 characters.
To view the ISO 8859-1 character set, which contains an extended set of characters above the standard
127 ASCII characters, view the iso_8859_1 man page.
To view the ISO 8859-1 character set, type:
$ man iso_8859_1 RET
You can use this page to see all of the characters in this character set and how to input them.
NOTE: Theres a special way to quote these characters in Emacs; this technique is described in Section 10.2.5 [Inserting Special Characters in Emacs], page 113.
The miscfiles package also contains charts for these character sets, as explained in Section 11.4
[Word Lists and Reference Files], page 130.
10 Text Editing
Text editing is one of the most fundamental activities of computing on Linux-based systems, or most any
computer for that matter. We edit text when writing a document, sending email, making a Web page,
posting an article for Usenet, programmingand the list goes on. Most people spend a good deal of their
computing time editing text with a text editor application.
There are a lot of text editors to choose from on Linux systems, as the first recipe in this chapter
shows, but the majority of editors fit in one of two families of editor: Emacs and Vi. Most users prefer
one or the other; rarely is one adept at both. I give more coverage to Emacs, and not only because its
my preferred editorits keystroke commands are used by default in many other tools and applications,
including the bash shell (see Chapter 3 [The Shell], page 33).
D ESCRIPTION
Anthonys Editor, ae, is a simple, easy-to-use text editor. It has modes to emulate
the behavior of other text editors.
Debian: ae
WWW: http://dmoz.org/Computers/Software/Editors/Vi/
cooledit
Cooledit is a popular, fast text editor for use in X; its features include anti-aliased
fonts, Unicode support, and extensibility via the Python programming language.
Debian: cooledit
WWW: http://cooledit.sourceforge.net/
dedit
DEdit is a simple editor for use in X with GNOME installed. It can read compressed files and display Japanese characters.
Debian: dedit
ee
Intended to be an editor that novices can begin using immediately, the Easy Editor
features pop-up menus.
Debian: ee
WWW: http://mahon.cwx.net/
elvis
Elvis is a modern implementation of Vi that comes with many new features and
extensions.
Debian: elvis
WWW: http://www.fh-wedel.de/elvis/
emacs
Emacs is one of the two most-popular text editors. Ive devoted an entire section
to it in this book: Section 10.2 [Emacs], page 108.
Debian: emacsen-common
Debian: emacs20
WWW: http://www.emacs.org/
jed
John E. Daviss jed offers many of the conveniences of Emacs and is geared
specifically toward programmers. It loads quickly, and makes editing files at a
shell prompt easy and fast.
Debian: jed
WWW: http://space.mit.edu/davis/jed.html
joe
Joes Own Editor, joe, is a full-screen editor with a look and feel reminiscent of
old DOS text editors like EDIT.
Debian: joe
WWW: ftp://ftp.std.com/src/editors/
nano
Nano is a free software editor inspired by Pico, the editor that is included with
the University of Washingtons proprietary Pine email program. Its also faster
than Pico, and comes with more features.
Debian: nano
WWW: http://www.nano-editor.org/
ted
Ted is a WYSIWYG text editor for use in X which reads and writes .rtf files
in Microsofts Rich Text Format.
Debian: ted
WWW: http://www.nllgg.nl/Ted/
the
The Hessling Editor is a configurable editor that uses the Rexx macro language.
It was inspired by the XEDIT editor for VM/CMS and the Kedit editor for DOS.
Debian: the
Debian: the-doc
WWW: http://www.lightlink.com/hessling/THE/
vi
vim
wily
xedit
Xedit is a simple text editor that comes with, and works in, X. It lets you insert,
delete, copy and paste text as well as open and save filesthe very basics.
Debian: xcontrib
xemacs
10.2 Emacs
Debian: emacsen-common
WWW: http://www.emacs.org/
To call Emacs a text editor does not do it justiceits a large application capable of performing many
functions, including reading email and Usenet news, browsing the World Wide Web, and even perfunctory psychoanalysis.
There is more than one version of Emacs. GNU Emacs is the Emacs released under the auspices of
Richard Stallman, who wrote the original Emacs predecessor in the 1970s. XEmacs (formerly Lucid
Emacs) offers essentially the same features GNU Emacs does, but also contains its own features for use
with the X Window System (it also behaves differently from GNU Emacs in some minor ways).
GNU Emacs and XEmacs are by far the most popular emacsen (as they are referred to in number);
other flavors include jed (described in the previous section) and Chets Emacs, ce, developed by a
programmer at Case Western Reserve University.
Following is a brief introduction to using Emacs, interspersed with the necessary Emacs jargon;
following that are recipes that describe how to use some of Emacss advanced editing features.
Upon startup in X, a typical GNU Emacs window looks like this (the window frame will differ
depending on your window manager):
The welcome message appears when Emacs first starts, and it tells you, among other things, how to
run a tutorial (which well look at in just a minute).
The top bar is called the menu bar, and you can pull down its menus with the mouse (or, in the
console, with C-F10).
A file or other text open in Emacs is held in its own area called a buffer. By default, the current buffer
appears in the large area underneath the menu bar. To write text in the buffer, just type it. The place in
the buffer where the cursor is at is called point, and is referenced by many Emacs commands.
The horizontal bar near the bottom of the Emacs window and directly underneath the current buffer is
called the mode line ; it gives information about the current buffer, including its name, what percentage
of the buffer fits on the screen, what line point is on, and whether or not the buffer is saved to a file.
The mode line also lists the modes active in the buffer. Emacs modes are general states that control the
way Emacs behavesfor example, when Overwrite mode is set, text you type overwrites the text at
point; in Insert mode (the default), text you type is inserted at point. Usually, either Fundamental
mode (the default) or Text mode will be listed.
The echo area is where Emacs writes brief status messages, such as error messages; it is the last line
in the Emacs window. When you type a command that requires input, that input is requested in this area
(and when that happens, the place you type your input, in the echo area, is then called the minibuffer ).
Emacs commands usually begin with a Control or Meta (Escape) key sequence; many commands
begin with the C-x sequence, which you type by pressing and holding the CTRL key and then pressing
the X key (see [Typographical Conventions], page 3).
Because Emacs is different in culture from the editors and approach of the Microsoft Windows and
Apple MacOS world, it has gotten a rather unfounded reputation in those corners that it is odd and
difficult to use. This is not so. The keyboard commands to run its various functions are designed for ease
of use and easy recall.
For example, the find-file function prompts for the name of a file and opens a copy of the file in
a new buffer; its keyboard accelerator is C-x C-f (you can keep CTRL depressed while you press and
release the X and F keys).
You can run any Emacs function by typing M-x followed by the function name and pressing RET.
To run the find-file function, type:
M-x find-file
RET
This command runs the find-file function, which prompts for the name of a file and opens a
copy of the file in a new buffer.
Type C-g in Emacs to quit a function or command; if you make a mistake when typing a command,
this is useful to cancel and abort the keyboard input.
Now that we have run through the essential Emacs terminology, Ill show you how to exit the
programjust type C-x C-c.
Emacs can have more than one buffer open at once. To switch between buffers, type C-x C-b. Then,
give the name of the buffer to switch to, followed by RET; alternatively, type RET without a buffer name
to switch to the last buffer you had visited. (Viewing a buffer in Emacs is called visiting the buffer.)
RET
A special buffer called *scratch* is for notes and things you dont want to save; it always exists
in Emacs.
RET
Any file names you give as an argument to emacs will open in separate buffers:
$ emacs todo rolo /usr/local/src/nirvarna/README
RET
(You can also make new buffers and open files in buffers later, of course.)
Emacs comes with an interactive, self-paced tutorial that teaches you how to use the basics. In my
experience, setting aside 25 minutes to go through the tutorial is one of the best things you can do in
your computing careereven if you decide that you dont like Emacs very much, a great many other
applications use Emacs-like keyboard commands and heuristics, so familiarizing yourself with them will
always pay off.
To start the tutorial at any time when you are in Emacs, type C-h t.
Incidentally, C-h is the Emacs help key; all help-related commands begin with this key. For example,
to read the Emacs FAQ, type C-h F, and to run the Info documentation browser (which contains The
GNU Emacs Manual ), type C-h i.
D ESCRIPTION
Move point up to the previous line.
or C-n
or C-b
Move point back through the buffer one character to the left.
or C-f
Move point forward through the buffer one character to the right.
PgUp
or C-v
PgDn
or M-v
BKSP
or C-h
DEL
or C-d
INS
Shift-INS
or C-y
Yank text in the kill ring at point (see Section 10.4.2 [Pasting Text],
page 115).
C-SPC
C-_
C-a
C-e
C-g
C-h F
C-h a function
RET
C-h i
Start Info.
C-h k key
Describe key.
C-h t
C-k
C-l
Re-center the text in the Emacs window, placing the line where point
is in the middle of the screen.
C-t
Transpose the character at point with the character to the left of point.
C-u number
C-w
C-x C-c
Save all buffers open in Emacs, and then exit the program.
RET
Open file in a new buffer for editing. To create a new file that does
not yet exist, just specify the file name you want to give it. To browse
through your files, type TAB instead of a file name.
C-left-click
SHIFT-left-click
NOTE: Emacs mode commands are toggles. So to turn off Abbrev mode in a buffer, just type M-x
abbrev-mode RET again. If you turn Abbrev mode on in that buffer later on during the Emacs
session, the abbrevs will be remembered and will expand again.
The preceding examples both do the same thing: they insert a formfeed character at point.
An interesting use of C-q is to underline text. To do this, insert a literal C-h character followed by
an underscore (_) after each character you want to underline.
To underline the character before point, type:
C-q C-h _
You can then use ul to output the text to the screen (see Section 13.3 [Underlining Text], page 143).
Another kind of special character insert you might want to make is for accented characters and other
characters used in various languages.
To insert an accented character, use ISO Accents mode. When this mode is active, you can type a
special accent character followed by the character to be accented, and the proper accented character will
be inserted at point.
The following table shows the special accent characters and the key combinations to use.
P LUS T HIS L ETTER
Y IELDS T HIS R ESULT
P REFIX . . .
"
a
a
"
e
e
i
"
i
"
o
o
"
u
u
"
s
a
e
i
o
u
a
e
i
o
u
a
e
i
o
u
a`
e`
`i
o`
u`
a
c
d
n
t
u
a
c
d
n
t
u
<
>
!
?
<<
>>
a
e
i
o
u
a
e
i
o
u
/
/
/
a
e
o
When a buffer contains accented characters, it can no longer be saved as plain ASCII text, but must
instead be saved as text in the ISO-8859-1 character set (see Section 9.4 [Viewing a Character Chart],
page 104). When you save a buffer, Emacs will notify you that it must do this.
To type the line Emacs ist spa! in the current buffer, type:
M-x iso-accents-mode
Emacs ist spa"ss!
RET
In the event that you want to type the literal key combinations that make up an accented character in
a buffer where you have ISO Accents mode on, type the prefix character twice.
To type the text o (and not the accent character o ) in a buffer while ISO Accents mode is on,
type:
o
NOTE: GNU Emacs has recently added a number of internationalization functions. A complete discussion of their use is out of the scope of this book; for more information on this topic, see section
International Character Set Support in The GNU Emacs Manual .
To run the vi tutorial, type the following from your home directory:
$ cp /usr/doc/nvi/vi.beginner.gz .
$ gunzip vi.beginner RET
$ vi vi.beginner RET
RET
When you have selected an area of text with the mouse as described previously, you can typeShiftDEL to delete it.
You can also click the left mouse button at one end of an area of text and then double-click the right
mouse button at the other end of the area to kill the area of text.
Finally, to kill a large portion of text in an Emacs buffer, set the mark at one end of the text by
moving point to that end and typing C-SPC. Then, move point to the other end of the text, and type
C-w to kill it.
This command redirects the standard output to a new file, novels, which would then contain the
following text:
This Side of Paradise
The Beautiful and Damned
The Great Gatsby
Tender is the Night
The Last Tycoon
The files early and later are not altered.
Had you typed cat later early > novels instead, the files would be concatenated in that reversed order instead, beginning with later; so the file novels would contain the following:
The Great Gatsby
Tender is the Night
The Last Tycoon
This Side of Paradise
The Beautiful and Damned
The following sections give other recipes for concatenating text.
NOTE: You can also use cat to concatenate files that are not text, but its most popular usage is with
text files. Another way to concatenate files of text in an automated way is to use file inclusionsee
Section 10.7 [Including Text Files], page 118.
A similar tool, zcat, reads the contents of compressed files.
In this example, the text file novels was created and contains four lines of text (the last line with
the C-d is never part of the file).
Typing text like this without an editor will sometimes do in a pinch but, if you make a mistake, there
is not much recourse besides starting overyou can type C-u to erase the current line, and C-c to abort
the whole thing and not write the text to a file at all, but thats about it.
RET
RET
In this example, no files were specified to cat for input, so cat used the standard input; then, one
line of text was typed, and this text was appended to file novels, the file used in the example of the
previous recipe. So now this file would contain the following:
This Side of Paradise
The Beautiful and Damned
The Great Gatsby
Tender is the Night
The Last Tycoon
RET
RET
This command inserts two lines of text at the beginning of novels, the file used in the previous
examples in this section. This file would now contain the following:
The Novels of F. Scott Fitzgerald
--------------------------------This Side of Paradise
The Beautiful and Damned
The Great Gatsby
Tender is the Night
The Last Tycoon
Clam Chowder
Lobster Bisque
Vegetable
BLT
Ham on Rye
Roast Beef
Soups
----include(soups)
Sandwiches
----------
include(sandwiches)
This command writes a new file, monday.txt, which looks like this:
Soups
----Clam Chowder
Lobster Bisque
Vegetable
Sandwiches
---------BLT
Ham on Rye
Roast Beef
NOTE: You can write more than one include file that will use your filesand the files themselves can
have include files of their own.
This is a fairly simple use of m4; it can do much more, including run commands, manipulate text, and
run custom macros. See Info file m4.info, node Top for more information on this tool.
11.1 Spelling
There are several ways to spell check text and files on Linux; the following recipes show how to find
the correct spellings of particular words and how to perform batch, interactive, and Emacs-based spell
checks.
The system dictionary file, /usr/dict/words, is nothing more than a word list (albeit a very
large one), sorted in alphabetical order and containing one word per line. Words that are correct regardless of case are listed in lowercase letters, and words that rely on some form of capitalization in order to
be correct (such as proper nouns) appear in that form. All of the Linux spelling tools use this text file to
check spelling; if a word does not appear in the dictionary file, it is considered to be misspelled.
NOTE: None of the computerized spell-check tools will correct your writing if you are using the wrong
word to begin withfor example, if you have there when you mean their, the computer will not
catch it (yet!).
$ spell RET
occurance RET
occurance
C-d
$
In the example, spell echoed the word occurance, meaning that this word was not in the
system dictionary and therefore was quite likely a misspelling. Then, C-d was typed to exit spell.
$ spell fall-lecture.draft
occurance
willl
occurance
$
RET
On an increasing number of systems, this file is being replaced with /usr/share/dict/words; administrators should
In this example, three words are output: occurance, willl and occurance again, meaning
that these three words were found in fall-lecture.draft, in that order, and were not in the
system dictionary (and so were probably misspelled). Note that the misspelling occurance appears
twice in the file.
To correct the misspellings, you could then open the file in your preferred text editor and edit it. Later
in this section Ill describe an interactive spell checker that allows you to correct misspellings as they are
found. Still another option is to use a text editor with spell-checking facilities built in, such as Emacs.
To spell check the file fall-lecture.draft, and output any possibly misspelled words to a
file fall-lecture.spelling, type:
$ spell fall-lecture.draft > fall-lecture.spelling RET
In this example, the standard output redirection character, >, is used to redirect the output to a file
(see Section 3.2.2 [Redirecting Output to a File], page 37).
To output an alphabetical list of the misspelled words, pipe the output to sort; then pipe the sorted
output to the uniq filter to remove duplicates from the list (uniq removes duplicate adjacent lines from
its input, outputting the unique lines).
To output a sorted list of the misspelled words that are in the file fall-lecture.draft, type:
$ spell fall-lecture.draft | sort | uniq RET
If a word is reasonably universal, you may, of course, contact the global maintainers of wenglish or other appropriate
packages and try to convince them that said word ought to be included.
When you type this, ispell begins checking the file. It stops at the first misspelling it finds:
On the top line of the screen, ispell displays the misspelled word, followed by the name of the file.
Underneath this is the sentence in which the misspelling appears, with the word in question highlighted.
Following this is a list of suggested words, each offset by a numberin this example, ispell has only
one suggestion: lectures.
To replace a misspelling with a suggested word, type the number that corresponds to the suggested
word (in this example, you would type 0 to replace the misspelling with lectures). You only need
to type the number of your selectiona RET is not required.
You can also type a correction yourself; this is useful when ispell either offers no suggestions, or
when it does and the word you want is not one of them. To do this, type r (for replace) and then type
the replacement word, followed by RET.
Sometimes, ispell will question a word that you may not want to count as a misspelling, such as
proper names and the likewords that dont appear in the system dictionary. There are a few things you
can do in such cases, as follows.
To accept a misspelled word as correct for the current ispell session only, type a; from then on
during the current session, this word will be considered correct.
If, however, you want ispell (and spell, and all other tools that access the system dictionary) to
remember this word as being correct for this and all future sessions, insert the word in your own personal
dictionary. Type u to insert a copy of the word uncapitalized, in all lowercase lettersthis way, even if
the word is capitalized at the beginning of a sentence, the lowercase version of the word is saved. From
then on, in the current ispell session and in future sessions, this word, regardless of case, will be
considered correct.
When case is important to the spellingfor example, in a word that is a proper name such as
Seattle, or a word with mixed case, such as LaTeXtype i to insert a copy of the word in
your personal dictionary with its case just as it appears; this way, words spelled with the same letters but
with different case will be considered misspellings.
When ispell finishes spell checking a file, it saves its changes to the file and then exits. It
also makes a copy of the original file, without the changes applied; this file has the same name
as the original but with .bak added to the endso in our example, the backup file is called
fall-lecture.notes.bak. This is useful if you regret the changes youve made and want to
restore the file to how it was before you mucked it upjust remove the spell-checked file and then
rename the .bak file to its original name.
number
Quit checking and restore the file to how it was before this session.
Save the changes thus made, and then stop checking this file.
Flyspell mode is another useful Emacs spelling command that, when set in a buffer, highlights
misspelled words. This function is useful when you are writing a first draft in a buffer, because it lets
you catch misspellings as you type them.
To turn on Flyspell mode in a buffer, type:
M-x flyspell-mode RET
Finally, if you prefer the sparse, non-interactive interface of spell, you can use the Emacs interfaces to that command instead: Spell word, Spell region, and Spell buffer. When any of
these commands find a misspelling, they prompt for a replacement in the minibuffer but do not offer
suggestions or provide any of ispells other features.
11.2 Dictionaries
Debian: wordnet-dev
WWW: http://www.cogsci.princeton.edu/wn/
The term dictionary on Linux systems generally refers to one of two things: the traditional Unix-style
dictionary, which is an alphabetically sorted word list containing no actual definitions, and the newer
database-style dictionary that contains the headwords as well as their definitions. The latter is the kind of
thing most people mean when they talk about dictionaries. (When most Unix folk talk about dictionaries,
however, they almost always mean the former.)
WordNet is a lexical reference system in the form of a database containing thousands of words arranged in synonym sets. You can search the database and output the results in text with the wn tool or
the wnb X client (the WordNet browser).
Use of the X client is fairly straightforwardtype a word in the dialog box near the top of the screen,
followed by RET, to get its definition(s), which are displayed in the large output window underneath the
dialog box.
For example, this is what appears when you do a search for the definition of the word browse:
Between the dialog box and the output window, there are menus for searching for synonyms and
other word senses. A separate menu is given for each part of speech a word may have; in the preceding
example, the word browse can be either a noun or a verb, so two menus are shown.
To get a list of all word sense information available for a given word, run wn with the name of the
word as an argument. This outputs a list of all word sense information available for the word, with each
possible sense preceded with the name of the option to use to output it.
To output a list of word senses available for the word browse, type:
$ wn browse
RET
To find some words that rhyme with a given word, use grep to search /usr/dict/words for
words ending in the same last few characters as the word they should rhyme with (see Section 14.2.2
[Matching Lines Ending with Certain Text], page 150).
To output a list of words that rhyme with friend, search /usr/dict/words for lines ending
with end:
$ grep end$ /usr/dict/words RET
Finally, to do a search on the WordNet dictionary, use wn with one of the -grep options. When you
give some text to search for as an argument, this command does the equivalent search as look, except
only the particular kind of word sense you specify is searched: -grepn searches nouns, -grepv
searches verbs, -grepa searches adjectives, and -grepr searches adverbs. You can combine options to search multiple word senses.
To search the WordNet dictionary for nouns that begin with homew, type:
$ wn homew -grepn RET
To search the WordNet dictionary for both nouns and adjectives that begin with homew, type:
$ wn homew -grepn -grepa RET
Readers Workbench; we can only guess at what that might have been, but today we do have Project Gutenbook
(http://www.gutenbook.org/), a new etext reader.
AT&T unbundled the Writers Workbench from their UNIX version 7 product, and as the many
flavors of Unix blossomed over the years, these tools were lost by the waysideeventually becoming
the stuff of Unix lore.
In 1997, Michael Haardt wrote new Linux versions of these tools from scratch. They support both
the English and German languages, and theyre now part of the GNU Project.
Two additional commands that were part of the Writers Workbench have long been standard on
Linux: look and spell, described previously in this chapter.
If you dont specify a file name, diction reads text from the standard input until you type C-d on
a line by itself. This is especially useful when you want to check a single sentence:
$ diction RET
Let us ask the question we wish to state. RET
(stdin):1: Let us [ask the question -> ask]
[we wish to state -> (cliche, avoid)].
C-d
$
To check the text of a Web page, use the text-only Web browser lynx with the -dump and
-nolist options to output the plain text of a given URL, and pipe this output to diction. (If
you expect there to be a lot of output, add another pipe at the end to less so you can peruse it.)
To peruse a copy of the text of http://example.org/1.html with markings for possible
wordy and misused phrases, type:
$ lynx -dump -nolist http://example.org/1.html | diction | less RET
To check a text file for doubled words only, and not for any of the other things diction checks, use
grep to find only those lines in dictions output that contain the text Double word, if any.
To output all lines containing double words in the file dissertation, type:
$ diction dissertation | grep Double word RET
Like diction, style reads text from the standard input if no text is giventhis is useful for the
end of a pipeline, or for checking the writing style of a particular sentence or other text you type.
The sentence characteristics of the text that style outputs are as follows:
Number of characters
Number of words, their average length, and their average number of syllables
Number of sentences and average length in words
Number of short and long sentences
Number of paragraphs and average length in sentences
Number of questions and imperatives
The various readability formulas that style uses and outputs are as follows:
Kincaid formula, originally developed for Navy training manuals; a good readability for technical
documentation
Automated Readability Index (ARI)
Coleman-Liau formula
Flesch Reading Ease Score, which gives an approximation of readability from 0 (difficult) to 100
(easy)
Fog Index, which gives a school-grade reading level
WSTF Index, a readability indicator for German documents
Wheeler-Smith Index, Lix formula, and SMOG-Grading tests, all readability indicators that give a
school-grade reading level
D ESCRIPTION
The GNU Manifesto.
abbrevs.talk.gz
abbrevs.gen.gz
Collections of common abbreviations used in electronic communication. (This is the place to look to find the secrets of TTYL and LOL.)
airport.gz
List of three-letter city codes for some of the major airports. The city
code is useful for querying the National Weather Service computers to
get the latest weather report for your region.
ascii.gz
birthtoken.gz
cities.dat.gz
inter.phone.gz
languages.gz
latin1.gz
A chart of the extended ASCII character set, also known as the ISO
8859 (Latin-1) character set.
mailinglists.gz
na.phone.gz
operator.gz
postal.codes.gz
Postal codes for U.S. and Mexican states and Canadian provinces.
us-constitution.gz
us-declaration.gz
The Declaration of Independence of the Thirteen Colonies. (On Debian systems, this file is placed in /usr/share/state.)
rfc-index.txt
zipcodes.gz
miscfiles is not the only reference package available for Debian systems, though; other related
packages include the following:
PACKAGE
doc-iana
D ESCRIPTION
Internet protocol parameter registry documents, as published by the
Internet Assigned Numbers Authority.
doc-rfc
jargon
vera
NOTE: The official GNU miscfiles distribution also includes the Jargon file and the
/usr/dict/words dictionary file, which are available in separate packages for Debian, and
are removed from the Debian miscfiles distribution. /usr/dict/words is part of the
standard spelling packages, and the Jargon file comes in the optional jargon package, and installs in
/usr/share/jargon.
12 Analyzing Text
There are many ways to use command-line tools to analyze text in various ways, such as counting the
number of words in a text, creating a concordance, and comparing texts to see if (and where) they differ.
There are also other tricks you can do with text that count as analysis, such as finding anagrams and
palindromes, or cutting up text to generate unexpected combinations of words. This chapter covers all
these topics.
To output the number of lines, words, and characters in file outline, type:
$ wc outline
RET
The following subsections describe how to specify just one kind of count with wc, and how to count
text in Emacs.
NOTE: You can get a count of how many different words are in a text, toosee Section 12.2 [Making a
Concordance of a Text], page 134. To count the average length of words, sentences, and paragraphs, use
style (see Section 11.3.3 [Checking Text for Readability], page 129).
RET
To output counts for several files, first concatenate the files with cat, and then pipe the output to wc.
To output the combined number of words for all the files with a .txt file name extension in the
current directory, type:
$ cat *.txt | wc -w
RET
NOTE: To read more about concatenation with cat, see Section 10.6 [Concatenating Text], page 116.
RET
NOTE: For more recipes for searching text, and more about grep, see Chapter 14 [Searching Text],
page 147.
Emacs outputs the number of lines per page of the current buffer in the echo area.
For example, if the output in the minibuffer is
Page has 351 lines (69 + 283)
this means that the current page contains 351 lines, and point is on line number 70there are 69 lines
before this line, and 283 lines after this line.
These commands translate all space characters to newline characters, outputting the text with each
word on its own line; this is then sorted alphabetically, and that output is passed to uniq, which outputs
only the unique linesthat is, all non-duplicate lineswhile the -c option precedes each line with its
count (the number of times it occurs in the text).
To get a word frequency countthat is, the total number of different words in a textjust pipe the
output of the frequency list to wc with the -l option. This counts all the lines of its input, which in this
case will be the list of unique words, one per line.
To output a count of the number of unique words in the text file naked_lunch, type:
$ tr RET
> < naked_lunch | sort | uniq -c | wc -l RET
&
!
Logical not.
Give as arguments the names of the files to rank.
To rank the files report.a, report.b, and report.c in order of relevance to the keywords saving and profit, type:
$ rel "(saving & profit)" report.a report.b report.c RET
Give the name of a directory tree to analyze all files in the directory tree.
To output a list of any files containing either invitation or request in the /mail
directory, ranked in order of relevancy, type:
$ rel "(invitation | request)" /mail RET
To output a list of any files containing invitation and not wedding in the /mail directory, ranked in order of relevancy, type:
$ rel "(invitation ! wedding)" /mail RET
To output a list of any files containing invitation and party in the /mail directory,
ranked in order of relevancy, type:
$ rel "(invitation & party)" /mail RET
To limit the anagrams output to those containing a given string, specify that string with the -c
option.
To output only anagrams of the phrase lakes and oceans which contain the string seas,
type:
$ an -c seas lakes and oceans RET
To print all of the words that some or all letters in a given word or phrase can make, use the -w
option. This outputs words that are not anagrams, since anagrams must contain all of the letters of the
other word or phrase.
To output all of the words that can be made from the letters of the word seas, type:
$ an -w seas RET
This command outputs all of the words that can be formed from all or some of the characters in
seas, including see and as.
These recipes describe a few of the common ways to make text cut-ups; more free software tools for
making cut-ups are listed at http://dsl.org/comp/cutups.shtml.
This command will output passages of random text based on the text in the file nova until it is
interrupted by the user.
You can analyze a text and save the analysis to a file of compiled data; this analysis can then be used
to generate random text when the original input text is not present. The following table describes this
and other dadadodo options.
O PTION
D ESCRIPTION
-c integer
Generate integer sentences (default is 0, meaning generate an infinite
amount until interrupted).
-l file
-o file
-p integer
Give a positive argument to the dissociated-press function to specify the number of characters
to use for overlap; give a negative argument to specify the number of words for overlap.
To generate a Dissociated Press cut-up from the current buffer, always overlapping by three characters, type:
C-u 3 M-x dissociated-press RET
To generate a Dissociated Press cut-up from the current buffer, always overlapping by one word,
type:
C-u -1 M-x dissociated-press RET
13 Formatting Text
Methods and tools for changing the arrangement or presentation of text are often useful for preparing
text for printing. This chapter discusses ways of changing the spacing of text and setting up pages, of
underlining and sorting and reversing text, and of numbering lines of text.
Use cat with the -s option to squeeze multiple adjacent blank lines into one.
To output the file term-paper with multiple blank lines output as only one blank line, type:
$ cat -s term-paper RET
You can combine both of these commands to output text with multiple adjacent lines removed and
give it a unified spacing between words. The following example shows how the output of the combined
commands is sent to less so that it can be perused on the screen.
To peruse the text file term-paper with multiple blank lines removed and giving the text unified
spacing between words, type:
$ cat -s term-paper | fmt -u | less RET
Notice that in this example, both fmt and less worked on their standard input instead of on a file
the standard output of cat (the contents of term-paper with extra blank lines squeezed out) was
passed to the standard input of fmt, and its standard output (the space-squeezed term-paper, now
with uniform spacing) was sent to the standard input of less, which displayed it on the screen.
This command outputs all lines that are not emptyso lines containing only non-printing characters,
such as spaces and tabs, will still be output.
To remove from the output all empty lines, and all lines that consist of only space characters, use [
]. as the regexp to search for. But this regexp will still output lines that contain only tab characters; to
remove from the output all empty lines and lines that contain only a combination of tab or space characters, use [[:space:]]. as the regexp to search for. It uses the special predefined [:space:]
regexp class, which matches any kind of space character at all, including tabs.
To output only the lines from the file term-paper that contain more than just space characters,
type:
$ grep [ ]. term-paper RET
To output only the lines from the file term-paper that contain more than just space or tab
characters, type:
$ grep [[:space:]]. term-paper RET
If a file is already double-spaced, where all even lines are blank, you can remove those lines from the
output by using sed with the n;d expression.
To output only the odd lines from file term-paper, type:
$ sed n;d term-paper RET
To send the output directly to the printer for printing, you would pipe the output to lpr:
$ pr -d -t term-paper | lpr RET
NOTE: The pr (print) tool is a text pre-formatter, often used to paginate and otherwise prepare text
files for printing; there is more discussion on the use of this tool in Section 13.2 [Paginating Text],
page 142.
The G expression appends one blank line to each line of seds output; using ; you can specify
more than one blank line to append (but you must quote this command, because the semicolon (;) has
meaning to the shellsee Section 3.1.1 [Passing Special Characters to Commands], page 34). You can
use multiple G characters to output text with more than double or triple spaces.
To quadruple-space the file term-paper, and write the output to the file
term-paper.print, type:
$ sed G;G;G term-paper > term-paper.print RET
The usage of sed is described in Section 10.5 [Editing Streams of Text], page 116.
$ fmt term-paper
RET
This command is almost always used for printing, so the output is usually just piped to lpr instead
of saved to a file. Many text documents have a width of 80 and not 72 columns; if you are printing such
a document and need to keep the 80 columns across the page, specify a new width of 85. If your printer
can only print 80 columns of text, specify a width of 80; the text will be reformatted to 75 columns after
the 5-column margin.
To print the file owners-manual with a 5-column margin and 80 columns of text, type:
$ pr -t -o 5 -w 85 owners-manual | lpr RET
To print the file owners-manual with a 5-column margin and 75 columns of text, type:
$ pr -t -o 5 -w 80 owners-manual | lpr RET
To convert multiple space characters to tabs, use unexpand. By default, it only converts leading
spaces into tabs, counting eight space characters for each tab. Use the -a option to specify that all
instances of eight space characters be converted to tabs.
To convert every eight leading space characters to tabs in file list2, and write the output to
list, type:
$ unexpand list2 > list RET
To convert all occurrences of eight space characters to tabs in file list2, and write the output to
the standard output, type:
$ unexpand -a list2
RET
To specify the number of spaces to convert to a tab, give that number as an argument to the -t
option.
To convert every leading space character to a tab character in list2, and write the output to the
standard output, type:
$ unexpand -t 1 list2
RET
To paginate the file listings and write the output to a file called listings.page, type:
$ pr -f -h "" listings > listings.page
RET
By default, pr outputs pages of 66 lines each. You can specify the page length as an argument to the
-l option.
To paginate the file listings with 43-line pages, and write the output to a file called
listings.page, type:
$ pr -f -h "" -l 43 listings > listings.page
RET
NOTE: If a page has more lines than a printer can fit on a physical sheet of paper, it will automatically
break the text at that line as well as at the places in the text where there are formfeed characters.
You can paginate text in Emacs by manually inserting formfeed characters where you want themsee
Section 10.2.5 [Inserting Special Characters in Emacs], page 113.
RET
To print the file news.update in four columns with no headers or footers, type:
$ pr -4 -t news.update | lpr
RET
Specify the number of columns to output text in, making all columns
fit the page width.
-a
-c
Output control characters in hat notation and print all other unprintable
characters in octal backslash notation.
-d
-f
-h header
Specify the header to use instead of the default; specify -h "" for a
blank header.
-l length
Specify the page length to be length lines (default 66). If page length
is less than 11, headers and footers are omitted and existing form feeds
are ignored.
-m
Use when specifying multiple files; this option merges and outputs
them in parallel, one per column.
-o spaces
Set the number of spaces to use in the left margin (default 0).
-t
Omit the header and footer on each page, but retain existing formfeeds.
-T
Omit the header and footer on each page, as well as existing formfeeds.
-v
-w width
NOTE: Its also common to use pr to change the spacing of text (see Section 13.1 [Spacing Text],
page 139).
RET
Both examples above used the special regexp symbol \1, which matches the same text matched
by the first \( ... \) construct in the previous regexp. See Info file emacs-e20.info, node
Regexps for more information on regexp syntax in Emacs.
To put a literal underline under text, you need to use a text editor to insert a C-h character followed
by an underscore (_) immediately after each character you want to underline; you can insert the C-h
in Emacs with the C-q function (see Section 10.2.5 [Inserting Special Characters in Emacs], page 113).
When a text file contains these literal underlines, use the ul tool to output the file so that it is viewable
by the terminal you are using; this is also useful for printing (pipe the output of ul to lpr).
To output the file term-paper so that you can view underbars, type:
$ ul term-paper
RET
To output such text without the backspace character, C-h, in the output, use col with the -u option.
To output the file term-paper with all backspace characters stripped out, type:
$ col -u term-paper
RET
Shantung
Honan
Szechwan
Hunan
Kiangsu
Kwangtung
Fukien
To sort the file provinces and output all lines in ascending order, type:
$ sort provinces
Fukien
Honan
Hunan
Kiangsu
Kwangtung
Shantung
Szechwan
$
RET
To sort the file provinces and output all lines in descending order, type:
$ sort -r provinces
Szechwan
Shantung
Kwangtung
Kiangsu
Hunan
Honan
Fukien
$
RET
Sort in phone directory order, with only letters, digits, and blanks being sorted.
-f
When sorting, fold lowercase letters into their uppercase equivalent, so that differences in case are ignored.
-i
-n
-o file
You can set the numbering style with the -b option followed by an argument. The following table
lists the possible arguments and describes the numbering style they select.
A RGUMENT
N UMBERING S TYLE
a
Number all lines.
t
pregexp
Only number lines that contain the regular expression regexp (see Section 14.2 [Regular ExpressionsMatching Text Patterns], page 148).
The default is for line numbers to start with one, and increment by one. Set the initial line number by
giving an argument to the -v option, and set the increment by giving an argument to the -i option.
To output the file report with each line of the file preceded by line numbers, starting with the
number two and counting by fours, type:
$ nl -v 2 -i 4 report RET
To number only the lines of the file cantos that begin with a period (.), starting numbering at
zero and using a numbering increment of five, and to write the output to cantos.numbered,
type:
$ nl -i 5 -v 0 -b p\. cantos > cantos.numbered RET
The other way to number lines is to use cat with one of the following two options: the -n option
numbers each line of its input text, while the -b option only numbers non-blank lines.
To peruse the text file report with each line of the file numbered, type:
$ cat -n report | less RET
To peruse the text file report with each non-blank line of the file numbered, type:
$ cat -b report | less RET
In the preceding examples, output from cat is piped to less for perusal; the original file is not
altered.
To take an input file, number its lines, and then write the line-numbered version to a new file, send
the standard output of the cat command to the new file to write.
To write a line-numbered version of file report to file report.lines, type:
$ cat -n report > report.lines RET
Specify a different separator with the -s option. This is often useful when specifying non-printing
characters such as formfeeds. To specify such a character, use the ANSI-C method of quoting (see
Section 3.1.1 [Passing Special Characters to Commands], page 34).
To output prizes in page-for-page reverse order, type:
$ tac -s $\f prizes RET
The preceding example uses the formfeed, or page break, character as the delimiter, and so it outputs
the file prizes in page-for-page reverse order, with the last page output first.
Use the -r option to use a regular expression for the separator string (see Section 14.2 [Regular
ExpressionsMatching Text Patterns], page 148). You can build regular expressions to output text in
word-for-word and character-for-character reverse order:
To output prizes in word-for-word reverse order, type:
$ tac -r -s [a-zA-z0-9\-] prizes RET
To output prizes in character-for-character reverse order, type:
$ tac -r -s .\| RET
prizes RET
14 Searching Text
Its quite common to search through text for a given sequence of characters (such as a word or phrase),
called a string, or even for a pattern describing a set of such strings; this chapter contains recipes for
doing these kind of things.
The preceding example outputs all lines in the file catalog that contain the exact string
Compact Disc; it will not match, however, lines containing compact disc or any other variation on the case of letters in the search pattern. Use the -i option to specify that matches are to be
made regardless of case.
To output lines in the file catalog containing the string compact disc regardless of the case
of its letters, type:
$ grep -i compact disc catalog RET
This command outputs lines in the file catalog containing any variation of the pattern compact
disc, including Compact Disc, COMPACT DISC, and comPact dIsC.
One thing to keep in mind is that grep only matches patterns that appear on a single line, so in the
preceding example, if one line in catalog ends with the word compact and the next begins with
disc, grep will not match either line. There is a way around this with grep (see Section 14.2.8
[Finding Phrases Regardless of Spacing], page 151), or you can search the text in Emacs (see Section 14.6.2 [Searching for a Phrase in Emacs], page 154).
You can specify more than one file to search. When you specify multiple files, each match that grep
outputs is preceded by the name of the file its in (and you can suppress this with the -h option.)
To output lines in all of the files in the current directory containing the word CD, type:
$ grep CD * RET
To output lines in all of the .txt files in the /doc directory containing the word CD, suppressing the listing of file names in the output, type:
$ grep -h CD /doc/*.txt RET
Use the -r option to search a given directory recursively, searching all subdirectories it contains.
To output lines containing the word CD in all of the .txt files in the /doc directory and in
all of its subdirectories, type:
$ grep -r CD /doc/*.txt RET
NOTE: There are more complex things you can search for than simple strings, as will be explained in
the next section.
The following table describes the special meanings of the metacharacters and gives examples of their
usage.
M EANING
M ETACHARACTER
.
Matches any one character, with the exception of the newline character.
For example, . matches a, 1, ?, . (a literal period character),
and so forth.
*
[]
Encloses a character set, and matches any member of the setfor example, [abc] matches either a, b, or c. In addition, the hyphen
(-) and caret () characters have special meanings when used inside brackets:
As the first character of a list, the caret means that any character except those in the list should be matched. For example, [a] matches
any character except a, and [0-9] matches any character except a
numeric digit.
Matches the beginning of the line. So a matches a only when it is
the first character on a line.
Matches the end of the line. So a$ matches a only when it is the last
character on a line.
\|
\+
\?
\{number \} Matches the previous regexp (one specified to the left of this construction) that number of timesso a\{4\} matches aaaa. Use
\{number,\} to match the preceding regexp number or more times,
\{,number \} to match the preceding regexp zero to number times,
and \{number1,number2 \} to match the preceding regexp from
number1 to number2 times.
\(regexp \)
NOTE: The name grep derives from a command in the now-obsolete Unix ed line editor toolthe
ed command for searching globally through a file for a regular expression and then printing those lines
was g/re/p, where re was the regular expression youd use. Eventually, the grep command was
written to do this search on a file when not using ed.
The following sections describe some regexp recipes for commonly searched-for patterns.
RET
To output all lines in the file book that begin with the text in the beginning, regardless of
case, type:
$ grep -i in the beginning book
RET
NOTE: These regexps were quoted with characters; this is because some shells otherwise treat the
character as a special metacharacter (see Section 3.1.1 [Passing Special Characters to Commands],
page 34).
The ed command is still available on virtually all unices, Linux inclusive, and the old g/re/p still works.
The default shell on most Linux systems, bash, doesntbut its still probably good practice to quote a regexp with a caret
in it.
To output lines in the file sayings ending with an exclamation point, type:
$ grep !$ sayings
RET
NOTE: To use $ in a regexp to find words that rhyme with a given word, see Section 11.2.1 [Listing
Words that Match a Pattern], page 126.
To output all lines in /usr/dict/words that are exactly two characters wide, type:
$ grep ..$ /usr/dict/words
RET
For longer lines, it is more useful to use a different construct: .\{number \}$, where number is
the number of lines to match. Use , to specify a range of numbers.
To output all lines in /usr/dict/words that are exactly seventeen characters wide, type:
$ grep .\{17\}$ /usr/dict/words
RET
To output all lines in /usr/dict/words that are twenty-five or more characters wide, type:
$ grep .\{25,\}$ /usr/dict/words
RET
To output all lines in playlist that contain either the patterns the sea or cake, type:
$ grep the sea\|cake playlist
RET
This command outputs any lines in playlist that match the patterns the sea or cake,
including lines matching both patterns.
To output all lines in playlist that contain both patterns the sea and cake, regardless of
case, type:
$ grep -i the sea playlist | grep -i cake
RET
NOTE: To match lines containing some regexps in a particular order, see Section 14.2.11 [Regexps for
Common Situations], page 152.
The -i option matches characters regardless of case; so, in this example, all vowel characters are
matched regardless of case.
NOTE: The Emacs editor has its own special search for doing thissee Section 14.6.2 [Searching for a
Phrase in Emacs], page 154.
You can also reverse the order and use the -v option to output all lines containing a given pattern
that are not in a given context.
To list lines from the file email-archive that contain the word narrative, but not when
it is quoted, type:
$ grep narrative email-archive | grep -v > RET
....$ or .\{4\}$
.\{70\}$
\*
tow.*ing$
contain a number
[0-9]
[0-9]*$
199[1-5]
\(195[7-9]\)\|\(196[0-9]\)
\.te\?xt
cat\.\+gory
cat\.\+\?gory
q[u]
\(ftp\|gopher\|http\|\)://.*\..*
N.*T.*K
The zgrep tool works just like grep, except it searches through the text of compressed files. It
outputs matches to the given pattern as if youd searched through normal, uncompressed files. It leaves
the files compressed when it exits.
To search through the compressed file README.gz for the text Linux, type:
$ zgrep Linux README.gz RET
To output matches and the lines before them, use -B; to output matches and the lines after them,
use -A. Give a numeric option with either of these options to specify that number of context lines.
To search /usr/dict/words for lines matching tsch and output two lines of context before
each line of output, type:
$ grep -B tsch /usr/dict/words RET
To search /usr/dict/words for lines matching tsch and output six lines of context after
each line of output, type:
$ grep -A6 tsch /usr/dict/words RET
To search /usr/dict/words for lines matching tsch and output ten lines of context before
and three lines of context after each line of output, type:
$ grep -B10 -A3 tsch /usr/dict/words RET
You can also search and replace text in an Emacs buffer; to do this, use the replace-regexp
function and give both the expression to search for and the expression to replace it with.
To replace the text helpless with the text helpful in the current buffer, type:
M-x replace-regexp RET helpless RET helpful RET
NOTE: You can also search and replace text in most text editors, including Emacs; see Section 14.6.4
[Searching and Replacing in Emacs], page 155.
NOTE: The word-search-backward function does the same as word-search-forward, except it searches backward through the buffer, from point to the beginning of the buffer.
The keyboard accelerator for this command is M-C-son most keyboards, you press and release
and then hold down CTRL while you type s. To repeat the last regexp search you made, type M-Cs C-s; then, as long as you have CTRL held down, you can keep typing s to advance to the next match,
just as you would with an incremental search.
ESC
This function is especially useful for replacing control characters with text, or for replacing text with
control characters, which you can specify with C-q, the quoted-insert function (see Section 10.2.5
[Inserting Special Characters in Emacs], page 113).
To replace all the M characters in the current buffer with regular linefeeds, type:
M-x replace-regexp RET C-q C-m RET C-q 012 RET RET
Letter or
spondence,
manuscript
Poster, sign
enscript;
SGMLtools
Texinfo;
LaTeX or LyX
To write the output to a file instead of spooling it, give the name of the file you want to output as an
argument to the -p option. This is useful when you dont have a PostScript printer and you need to
convert the output first, or for when you just want to make a PostScript image file from some text, or for
previewing the output before you print it. In the latter case, you can view it on the display screen with
a PostScript viewer application such as ghostview (see Section 17.1.2 [Previewing a PostScript File],
page 183).
To write the text file saved-mail to a PostScript file, saved-mail.ps, and then preview it
in X, type:
$ enscript -p report.ps saved-mail RET
$ ghostview saved-mail.ps RET
The following recipes show how to use enscript to output text with different effects and properties.
NOTE: Once you make a PostScript file from text input, you can use any of the tools to format this new
PostScript file, including rearranging and resizing its pages (see Chapter 20 [PostScript], page 205).
Courier14 outputs text in the Courier font at 14 points, and Times-Roman12.2 outputs text
in the Times Roman font at 12.2 points. Some of the available font names are listed in the file
/usr/share/enscript/afm/font.map; the enscript man page describes how to use additional fonts that might be installed on your system.
To print the contents of the text file saved-mail on a PostScript printer, with text set in the
Helvetica font at 12 points, type:
$ enscript -B -f "Helvetica12" saved-mail RET
To make a PostScript file called saved-mail.ps containing the contents of the text file
saved-mail, with text set in the Helvetica font at 12 points, type:
$ enscript -B -f "Helvetica12" -p saved-mail.ps saved-mail RET
The -B option was used in the preceding examples to omit the output of a header on each page.
When headers are used, theyre normally output in 10-point Courier Bold; to specify a different font for
the text in the header, give its name as an argument to the -F option.
To print the contents of the text file saved-mail to a PostScript printer, with text set in 10-point
Times Roman and header text set in 18-point Times Bold, type:
$ enscript -f "Times-Roman10" -F "Times-Bold18" saved-mail RET
To make a PostScript file called saved-mail.ps containing the contents of the text file
saved-mail, with text and headers both set in 16-point Palatino Roman, type:
$ enscript -f "Palatino-Roman16" -F "Palatino-Roman16" -p
saved-mail.ps saved-mail RET
$ enscript -B -f "Helvetica-Bold72"
RET
RET
CAUTION
RET
RET
WET PAINT!
C-d
RET
72-point type is very large; use the --word-wrap option with longer lines of text to wrap lines
at word boundaries if necessary. You might need this option because at these larger font sizes, you run
the risk of making lines that are longer than could fit on the page. You can also use the -r option
to print the text in landscape orientation, as described in Section 15.2.5 [Outputting Text in Landscape
Orientation], page 163.
To print a sign in 63-point Helvetica Bold across the long side of the page, type:
RET
RET
RET
RET
NOTE: To make a snazzier or more detailed message or sign, you would create a file in a text editor and
justify the words on each line in the file as you want them to print, with blank lines where necessary.
If youre getting that complicated with it, it would also be wise to use the -p option once to output
to a file first, and preview the file before printing it (see Section 17.1.2 [Previewing a PostScript File],
page 183).
Assembler listings.
awk
bash
C programming language.
changelog
ChangeLog files.
cpp
csh
delphi
diff
diffu
elisp
fortran
haskell
html
idl
java
javascript
ksh
m4
makefile
nroff
objc
pascal
perl
postscript
python
scheme
sh
skill
sql
Sybase 11 SQL.
states
synopsys
tcl
tcsh
vba
verilog
vhdl
vrml
zsh
Z-shell programming language.
To pretty-print a file, give the name of the filter to use as an argument to the -E option, without any
whitespace between the option and argument.
To pretty-print the HTML file index.html, type:
$ enscript -Ehtml index.html RET
To pretty-print an email message saved to the file important-mail, and output it with no
headers to a file named important-mail.ps, type:
$ enscript -B -Email -p important-mail.ps important-mail RET
Use the special --help-pretty-print option to list the languages supported by the copy of
enscript you have.
To peruse a list of currently supported languages, type:
$ enscript --help-pretty-print | less RET
Without the -G option, enscript outputs text with a plain header in bold text, printing the file
name and the time it was last modified. The -B option, as described earlier, omits all headers.
You can customize the header text by quoting the text you want to use as an argument to the -b
option. Use the special symbol $% to specify the current page number in the header text.
To print the contents of the text file saved-mail with a custom header label containing the
current page number, type:
RET
NOTE: You can create your own custom fancy headers, toothis is described in the
CUSTOMIZATION section of the enscript man page.
The -r option is useful for making horizontal banners by passing output of the figlet tool to
enscript (see Section 16.3.1 [Horizontal Text Fonts], page 178).
To output the text This is a long banner in a figlet font and write it to the default printer
with text set at 18-point Courier and in landscape orientation, type:
$ figlet "A long banner" | enscript -B -r -f "Courier18" RET
To print just the odd or even pages, use the special odd and even arguments. This is good for
printing double-sided pages: first print the odd-numbered pages, and then feed the output pages back
into the printer and print the even-numbered pages.
To print the odd-numbered pages of the file saved-mail with the default headers, type:
$ enscript -a odd saved-mail RET
To print the even-numbered pages of the file saved-mail with the default headers, type:
$ enscript -a even saved-mail RET
-apages
Specify the page numbers to be printed, where pages is a commadelineated list of page numbers. Specify individual pages by their
numbers, and specify a range of pages by giving the first and last page
numbers in the range separated by a hyphen (-). The special odd
prints odd-numbered pages and even prints even-numbered pages.
-dprinter
-Elanguage
-Hnumber
Specify the height of highlight bars, in lines (without number, the value
of 2 is used).
-inumber
Indent lines by number characters, or follow number with a letter denoting the unit to use: c for centimeters, i for inches, or p for
PostScript points (1/72 inch).
-Ifilter
Pass input files through filter, which can be a tool or quoted command.
-j
-Lnumbers
-utext
-Unumber
--highlight-bargray=number
Specify the level of gray color to be used in printing the highlight bars,
from 0.0 (gray) to 1.0 (white).
--margins=
left :right :
top :bottom
Adjust left, right, top, and bottom page margins; the measurements
are in PostScript points, and, when specifying the values, any can be
omitted. (Given on one line all as one long option.)
--rotate-even-pages
You can also import your LaTeX files (and plain text) into LyX for further layout or manipulation.
The following recipes show how to get started using LyX, and where to go to learn more about it.
docbook_template.lyx
hollywood.lyx
Format for movie scripts as they are formatted in the U.S. film industry.
iletter.lyx
latex8.lyx
letter.lyx
linuxdoctemplate.lyx
revtex.lyx
Article format suitable for submission to publications of the American Physical Society (APS), American Institute of Physics (AIP), and
Optical Society of America (OSA).
slides.lyx
Format for producing slides and transparencies.
To view how the document will look when you print it, choose View DVI from the File menu.
This command starts the xdvi tool, which previews the output on the screen. (For more on using xdvi,
see Section 17.1.1 [Previewing a DVI File], page 183).
To print the document, choose Print from the File menu. You can also export it to LaTeX,
PostScript, DVI, or plain text formats; to do this, choose Export from the File menu and then select
the format to export to.
NOTE: If you plan on editing the document again in LyX, be sure to save the actual .lyx document
file.
This command opens the LyX tutorial, which you can then read on the screen or print out by selecting
Print from the File menu.
The following table lists the names of the available manuals as they appear on the Help menu, and
describes what each contains:
M ANUAL
D ESCRIPTION
Introduction
An introduction to using the LyX manuals, describing their contents
and how to view and print them.
Tutorial
Users Guide
The main LyX usage manual, describing all of the commonly used
commands, options, and features.
Extended Features
Customization
Reference Manual
Known Bugs
LyX is in active development, and like any large application, bugs have
been found. They are listed and described in this document.
ItemizeBullets.lyx
Literate.lyx
MathLabeling.lyx
Math_macros.lyx
Minipage.lyx
TableExamples.lyx
aa_head.lyx
aa_paper.lyx
aas_sample.lyx
amsart-test.lyx
amsbook-test.lyx
Files discussing and showing the use of LyX in the field of astronomy.
Examples of documents written in the format used by the American
Mathematical Society.
docbook_example.lyx
multicol.lyx
scriptone.lyx
LaTeX, these formats are widely used, especially on Linux systems, so every Linux user has the potential
to encounter one of these files, and ought to know how to process them.
NOTE: TEX doesnt sound like the name of a cowboy, nor LaTeX like a kind of paint: the letters T,
E, and X represent the Greek characters tau, epsilon, and chi (from the Greek techne, meaning art
and science). So the last sound in TEX is like the ch in Bach, and LaTeX, depending on local
dialect, is pronounced either lay-teck or lah-teck. Those who become highly adept at using
the system, Knuth calls TEXperts.
In this example, grep didnt return any matches, so its safe to assume that gentle.tex is a TEX
file and not a LaTeX file.
NOTE: For more on grep and searching for regular expressions, see Section 14.2 [Regular
ExpressionsMatching Text Patterns], page 148.
Once you have produced a DVI output file with this method, you can do the following with it:
Preview it on the screen with xdvi; see Section 17.1.1 [Previewing a DVI File], page 183
Print it with dvips or lpr; see Section 25.2.2 [Printing with Dvips], page 240
Convert it to PostScript with dvips; see Section 25.3.2 [Preparing a DVI File for Printing],
page 241; (then, you can also convert the PostScript output to PDF or plain text)
To ensure that all of the cross references in lshort.tex have been generated properly, run the
input file through latex once more:
$ latex lshort.tex RET
The lshort.dvi file will be rewritten with an updated version containing the proper page numbers in the cross reference and index entries. You can then view, print, or convert this DVI file as
described in the previous recipe for processing TEX files.
label.tex
A single mailing label for printing on standard 15-up sheets.
The following table lists the file names of the LaTeX templates, and describes their use. Use latex
to process files you make with these templates (see Section 15.4.3 [Processing LaTeX Files], page 168).
D ESCRIPTION
T EMPLATE F ILE
letter.ltx
A letter or other correspondence.
article.ltx
manuscript.ltx
A book manuscript.
There are more complex template packages available on the net that you might want to look at:
Rob Rutten has assembled a very nice collection of LaTeX templates,
http://www.astro.uu.nl/rutten/rrtex/templates/
The largest listing of LaTeX and TeX templates and style files is in the TEX Catalogue Online,
ftp://ftp.cdrom.com:21/pub/tex/ctan/help/Catalogue/hier.html
The Midnight Macros are a collection of TEX macros for printing booklets, bulk letters, and outlines,
ftp://ftp.cdrom.com/pub/tex/ctan/macros/generic/midnight/
Bjorn
Magnussons
LaTeX
templates
for
folder
and
register
labels,
http://www.ifm.liu.se/bjmag/latex.shtml
installed at /usr/share/texmf/tex/latex/labels/.
The manuscript template requires that your system has the LaTeX style file called manuscript.sty; most T X distriE
With the SGMLtools package, you can write documents and generate output in many different kinds of
formatsincluding HTML, plain text, PDF, and PostScriptall from the same plain text input file.
SGML (Standard Generalized Markup Language) is not an actual format, but a specification for
writing markup languages; the markup language formats themselves are called DTDs (Document
Type Definition). When you write a document in an SGML DTD, you write input as a plain text file
with markup tags.
The various SGML packages on Linux are currently in a state of transition. The original
SGML-Tools package (known as LinuxDoc-SGML in another life; now SGMLtools v1) is
considered obsolete and is no longer being developed; however, the newer SGMLtools v2 (a.k.a.
SGMLtools Next Generation and SGMLtools 98) is still alpha software, as is SGMLtools-lite
(http://sgmltools-lite.sourceforge.net/), a new subset of SGMLtools.
In the interim, if you want to dive in and get started making documents with the early SGMLtools
and the LinuxDoc DTD, its not hard to do. While the newer DocBook DTD has become very popular, it
may be best suited for technical books and other very large projectsfor smaller documents written by
individual authors, such as a multi-part essay, FAQ, or white paper, the LinuxDoc DTD still works fine.
And since the Linux HOWTOs are still written in LinuxDoc, the Debian project has decided to
maintain the SGMLtools 1.0 package independently.
The SGML-Tools Users Guide comes installed with the sgml-tools package, and is available
in several formats in the /usr/doc/sgml-tools directory. These files are compressed; if you
want to print or convert them, you have to uncompress them first (see Section 8.5 [Compressed Files],
page 92).
RET
D ESCRIPTION
Generates HTML files.
sgml2info
sgml2lyx
sgml2latex
sgml2rtf
sgml2txt
sgml2xml
RET
RET
In this example, sgml2latex writes a LaTeX input file from the SGML source file, and then the
latex tool processes the LaTeX file to make DVI output, which is processed with dvips to get the
final output: a PostScript file called myfile.ps with a paper size of US letter.
To make a PDF file from the PostScript file, you need to take one more step and use ps2pdf, part of
the gs or Ghostscript package; this converts the PostScript to PDF.
RET
Maxwell
PostScript
The PostScript language is generally considered to be a format generated by software, but some people write straight PostScript! Section 15.2 [Converting Plain Text for Output], page 159, has recipes
on creating PostScript output from text, including outputting text in a
font.
People have written PostScript template files for creating all kinds of
documentsfrom desktop calendars to mandalas for meditation. The
Debian cdlabelgen and cd-circleprint packages contain
tools for writing labels for compact discs. Also of interest are Jamie
Zawinskis templates for printing label inserts for video and audio
tapes; edit the files in a text editor and then view or print them as you
would any PostScript file.
WWW: http://www.jwz.org/audio-tape.ps
WWW: http://www.jwz.org/video-tape.ps
StarWriter
Texinfo
16 Fonts
A font is a collection of characters for displaying text, normally in a common typeface and with a
common size, boldness, and slant.
This chapter discusses the most popular kinds of fonts used on Linux systems: display fonts for use
in the X Window System, fonts for use in virtual consoles, and the fonts often seen in Usenet and email
composed entirely of ASCII characters.
Omitted are reference of the use of fonts with TEX, which are the kind of fonts youre most likely
to use when producing typeset outputit is beyond the scope of this book to cover that issue with the
space it needs. However, to print a text file with a font, see Section 15.2.1 [Outputting Text in a Font],
page 159.
For more information on fonts and the tools to use them, see the Font HOWTO (see Section 2.8.6
[Reading System Documentation and Help Files], page 31).
16.1 X Fonts
You can specify a font as an option to most X clients, so that any text in the client is written in the given
font. The recipe that describes how to do this is in Section 4.2.3 [Specifying a Window Font], page 51.
When you specify a font as an option, you have to give the X font name, which is the exact name
used to specify a specific font in X. (An easy way to get the X font name is described in the first recipe
in this section.) X font names consist of 14 fields, delimited by (and beginning with) a hyphen. All fields
must be specified, and empty fields are permitted:
-fndry-fmly-wght-slant-swdth-adstyl-pxlsz
-ptsz-resx-resy-spc-avgwdth-rgstry-encdng
The preceding line was split because of its length, but X font names are always given on one line.
The following table describes the meaning of each field.
D ESCRIPTION
F IELD
fndry
The type foundry that digitized and supplied the font data.
fmly
wght
The weight of the font, or its nominal blackness, the degree of boldness or thickness of its characters. Values include heavy, bold,
medium, light, and thin.
slant
swdth
adstyl
pxlsz
ptsz
resx
The horizontal screen resolution the font was designed for, in dpi
(dots per inch).
resy
The vertical screen resolution the font was designed for, in dpi.
spc
The kind of spacing used by the font (its escapement class ); either p
(a proportional font containing characters with varied spacing), m (a
monospaced font containing characters with constant spacing), or c
(a character cell font containing characters with constant spacing and
constant height).
avgwdth
The average width of the characters used in the font, in 1/10th pixel
units.
rgstry
encdng
The row of buttons are pull-down menus containing options available on your system for each field
in the X font name. Use the mouse to select items from each menu, and the X font you have selected is
shown in the main window. Above it is written its X font name.
To make the X font name the X selection, click the mouse on the button labeled select.
This example makes the X font name the X selection, which makes it possible to paste the X font
name to a command line or into another window (see Section 10.4.2 [Pasting Text], page 115).
NOTE: This is not a way to display the characters in a font; for that, use xfd, described next. Furthermore, to browse through available X fonts, you want to use xfontsel, as in the previous recipe.
RET
RET
Some font files contain more than one height (or size) of the font. If a font contains more than one
encoding for different heights, give the height to use as an argument to the -H option. (If you try to do
it without the option anyway, consolechars will output a list of available sizes.)
Common console font heights include 8 (for 8x8 fonts), 14 (for 8x14 fonts), and 16 (for 8x16 fonts).
To set the console font to the 8x8 size sc font, type:
$ consolechars -H 8 -f sc
RET
RET
Unfortunately, the breadth of characters that banner understands is a bit limitedthe following
characters cant be used in a banner message:
< > [ ] \ _ { } |
To make a banner of the contents of a text file, send its contents to banner by redirecting standard
input (see Section 3.2.1 [Redirecting Input to a File], page 36).
To make a banner of the contents of the file /etc/hostname, type:
$ banner < /etc/hostname RET
The default width of a banner is 132 text columns; you can specify a different width by specifying
the width to use as an argument to the -w option. If you give the -w option without a number, banner
outputs at 80 text columns.
To make a banner containing the text Happy Birthday Susan at a width of 23 text columns,
type:
$ banner -w 23 Happy Birthday Susan RET
To make a banner containing the text Happy Birthday Susan at a width of 80 text columns,
type:
$ banner -w Happy Birthday Susan RET
NOTE: A method of making a horizontal text banner with figlet is described in Section 15.2.5 [Outputting Text in Landscape Orientation], page 163.
The Definitive Type Manager is a tool for adding and removing Adobe Type 1
fonts to and from your system.
Debian: dtm
fonter
Fonter is a console font editor; use it to make and edit console fonts.
Debian: fonter
gfont
The gfont tool creates a GIF image of text rendered in a TEX font.
Debian: gfont
WWW: http://www.engelschall.com/sw/gfont/
gfontview
17 Viewing Images
As with text, there are tools for both viewing and editing images. This chapter describes the various
methods for viewing images; the editing of images is discussed in the next chapter). While you can view
an image with an image editor, it is safer (and faster!) to view with a viewer when you do not intend to
edit it.
To magnify the view of the document, left-click any of the buttons labelled with a percentage, such
as 17%; they magnify the view by that percentage.
To magnify the view by 33%, left-click the button marked 33%.
P
C-c
Same as Q.
C-d
Same as Q.
SPC
Same as N.
C-l
R
Press Q to exit and press SPC to advance to the next page, if there is one.
NOTE: Some people prefer the gv tool as an alternate to ghostview; gv is used in much the same
way, though it has a different interface.
RET
To exit xpdf, press Q; use the two magnifying-glass buttons to zoom the view closer in (+) or
further out (-), and use the left and right arrow buttons to move to the previous and next pages, if any.
NOTE: You can also use gv to preview PDF files.
RET
The mouse buttons have special meaning in display. Left-click on the image window to open the
display command menu in a new window. The display command menu looks like this:
Menu items let you change the image size and otherwise change or transform the image display.
Choose Overview from the Help menu for an explanation of the various available display commands.
Middle-click on the image to open a new window with a magnified view of the image centered where
you click. For example, middle-clicking on the sailboat image in the previous example will open a new
window that looks like this:
Finally, right-click on the image window for a pop-up menu containing a few of the most frequentlyused commands; to choose one of these commands, drag the mouse pointer over the command. Commands in the pop-up menu include Quit, which exits display, and the Image Info, which displays
information about the image file itself, including number of colors, image depth, and resolution.
The following table describes some of the keyboard commands that work when displaying an image
in display.
C OMMAND
D ESCRIPTION
SPC
Display the next image specified on the command line.
BKSP
C-q
C-s
<
>
Open a new window with information about the image, including resolution, color depth, format, and comments, if any.
NOTE: display can also be used to view images on the World Wide Websee Section 31.2 [Viewing
an Image from the Web], page 288.
In the preceding example, only those files with image formats supported by display are read and
displayed.
NOTE: To open an image at its normal size, right-click the image and choose Load; the thumbnail will
be replaced by its full-size image. To return to the thumbnail directory, right-click the image and choose
Former.
When you run zgv with no options, it displays image icons of any images in the current directory,
listing any subdirectories as folder icons. You can also give the name of a directory as an argument in
order to browse the images in that directory.
To browse the images in the current directory, type:
$ zgv RET
To browse the images in the /usr/share/gimp/scripts directory, type:
$ zgv /usr/share/gimp/scripts RET
Use the arrow keys to navigate through the file display; the red border around a image or directory
icon indicates which image or subdirectory is selected. Type RET to view the selected image or to change
to the selected directory.
You can manipulate the images you view in a number of wayszoom the image magnification in and
out, change the brightness and color, and even make automatic slide shows of images. The following
table describes some of zgvs options.
O PTION
D ESCRIPTION
-c
Toggle image centering. Images are centered on screen by default;
specifying this option turns off centering.
-i
-l
Start zgv in slide-show mode, where it loops through all images specified as arguments, continuously, until you interrupt it.
-M
-r integer
Reread and redisplay every image after every integer seconds. Useful
for viewing webcam images or other image files that are continuously
changing.
The preceding example will open two new windowsa small xpcd command bar window, and a
larger window containing thumbnails of all PhotoCD images on the disc.
To open a copy of an image in a new window, left-click its thumbnail image. When you do, xpcd
will open the image at the second-smallest PhotoCD resolution, 256x384; to view it at a another size,
right-click the image and choose the size to view. Once the new window is drawn, you can right-click on
this new image to save it as a JPEG, PPM, or TIFF format image.
To view an individual .pcd file with xpcd, give the name of the file as an argument.
To view the PhotoCD file driveby-001.pcd, type:
$ xpcd driveby-001.pcd RET
NOTE: You can also use display to view a .pcd PhotoCD image file (see Section 17.2 [Viewing
an Image in X], page 184).
See Section 19.3 [Extracting PhotoCD images], page 203 for another recipe for extracting PhotoCD
images.
Displays files in the special X Window Dump file format, as created by xwd.
Debian: xbase-clients
WWW: http://www.xfree86.org/
showpicture
xli
xloadimage
Nice graphics viewer for X that contains tools for viewing images in the root
window.
Debian: xloadimage
aview
View graphics as ASCII art. This tool can view any image format supported
by the pbmplus utility suite, and has fluid zoom in/out and all the rendering
options youd expect from a world-class viewer.
Debian: aview
WWW: ftp://ftp.ta.jcu.cz://pub/aa
18 Editing Images
When you take an image filesuch as one containing a digitized photograph or a picture drawn with a
graphics programand you make changes to it, you are editing an image.
This chapter contains recipes for editing and modifying images, including how to convert between
image file formats. It also gives an overview of other image applications you might find useful, including
the featuresome GIMP image editor.
NOTE: You can also perform many of the image transformations described in the following sections
interactively with the GIMP (see Section 18.3 [Editing Images with the GIMP], page 198).
RET
When mogrify resizes an image, it maintains the images aspect ratio, so that the ratio between the
width and height stays the same. To force a conversion to a particular image size without necessarily
preserving its aspect ratio, append the geometry with an exclamation point.
RET
You can also specify the width or height by percentage. To decrease by a percentage, give the value
followed by a percent sign (%). To increase by a percentage, give the value plus 100 followed by a
percent sign. For example, to increase by 25 percent, give 125%.
To increase the height of phoenix.jpeg by 25 percent and decrease its width by 50 percent,
type:
$ mogrify -geometry 125%x50% phoenix.jpeg
RET
NOTE: To view an image at a particular scale without modifying it, use display; when you resize its
window, you resize the image on the screen only (see Section 4.3.2 [Resizing a Window], page 53).
NOTE: After this command, the width of phoenix.jpeg now exceeds its height, so to rotate it again
use > instead of <.
RET
Use the -dither option to reduce the colors with Floyd-Steinberg error diffusion, a popular algorithm for improving image quality during color reduction.
To reduce the colors in phoenix.jpeg to four and apply Floyd-Steinberg error diffusion, type:
$ mogrify -colors 4 -dither phoenix.jpeg RET
This transforms the original phoenix.jpeg to:
Use the -map option with a second file name as an argument to read the color map, or the set of
colors, from the second image and use them in the first image.
To change the colors in the file rainbow.jpeg to those used in the file prism.jpeg, type:
$ mogrify -map prism.jpeg rainbow.jpeg RET
Use the -monochrome option to make a color image black and white.
To make the color image rainbow.jpeg black and white, type:
$ mogrify -monochrome rainbow.jpeg RET
If you have a PPM file, use ppmquant to quantize, or reduce to a specified quantity the colors in the
imagesee the ppmquant man page for details (see Section 2.8.4 [Reading a Page from the System
Manual], page 28).
Because of differences in display hardware, the brightness of an image may vary from one computer
system to another. For example, images created on a Macintosh usually appear darker on other systems.
When you adjust the brightness of an image it is called gamma correction.
To adjust the brightness of an image, give the numeric level of correction to apply as an argument to
the -gamma option. Most PC displays have a gamma value of 2.5, while Macintosh displays have a
lower gamma value of 1.4.
To set the gamma correction of the image rainbow.jpeg to .8, type:
$ mogrify -gamma .8 rainbow.jpeg RET
You wont see the annotation when you view the image; it is added to the image header in the file.
You can, however, read image annotations with tools that display information about an image file, such
as display or the GIMP. To read annotations in JPEG files, you can also use the rdjpgcom toolit
outputs any comments in the JPEG file whose file name is given as an argument.
To read any comments made in the image file phoenix.jpeg, type:
NOTE: Another method for writing comments in JPEG files is to use wrjpgcom, which is distributed
with rdjpgcom in the libjpeg-progs package.
NOTE: The border is added to the outside of the existing image; the image is not cropped or reduced in
size to add the border.
The -frame option works like -border, but it adds a more decorative border to an image.
To add a decorative frame eight pixels wide and eight pixels high to phoenix.jpeg, type:
RET
To create a montage from the files owl.jpeg, thrush.jpeg, and warbler.jpeg and
write it to endangered-birds.png, type:
$ montage owl.jpeg thrush.jpeg warbler.jpeg endangered-birds.png
RET
NOTE: In this example, three JPEGs were read and output to a PNG file; to specify the format to use in
the output, give the appropriate file extension in the output file name.
RET
You can specify the percentage to blend two images together with the -blend option. Give the
amount to blend the second image into the first (as a percentage) as an argument to the option.
To combine the image files phoenix.jpeg and ashes.jpeg so that the blended image
contains 70 percent of the second image, type:
$ combine -blend 70 ashes.jpeg phoenix.jpeg picture.jpeg
RET
This command combines the two images and writes a new image file, picture.jpeg, whose
contents contain 70 percent of the first image.
NOTE: Use -blend 50 to blend the two source files equally.
NOTE: xmorph is a tool for morphing images; see Section 18.4 [Interactive Image Editors and Tools],
page 199.
This command converts the JPEG image phoenix.jpeg to PNG format and writes it to a new
file, phoenix.png.
The following table lists the file extensions to use and describes their format. (The convention is to
give extensions in all lowercase letters.)
I MAGE F ORMAT
F ILE E XTENSION
bmp
Microsoft Windows bitmap image.
cgm
cmyk
RET
eps
fax
fig
fpx
FlashPix format.
gif
gray
pbm
pcd
pcl
pcx
pict
png
pnm
ppm
ps
rgb
tga
xbm
xpm
xwd
version
GIF89a
When converting a file to JPEG format, be sure to use the -interlace NONE option to make
sure the resultant JPEG image is non-interlacedunless, of course, you want an interlaced image; an
interlaced image is drawn in multiple passes, and is often used on the Web where a reader may view the
low-resolution image consisting of early passes before the entire image is downloaded. A non-interlaced
image is drawn in one single pass.
For example, use convert to convert a PNM file to non-interlaced JPEG, while sharpening it,
adding a border, and adding a copyright statement.
To convert the PNM file pike.pnm to non-interlaced JPEG while sharpening the image by 50
percent and adding both a 2x2 border and a copyright comment, type:
$ convert -interlace NONE -sharpen 50 -border 2x2
-comment copyright 1999 MS pike.pnm pike.jpeg RET
This command writes its output to a file pike.jpeg. Notice that the options -border and
-comment were previously described for the mogrify tool. Some ImageMagick tools share common options, which is useful if you are making multiple changes to an image file at once; only one tool
is needed for the job.
NOTE: Some image formats are lossy, in that some image information is lost when you convert to
it. For example, the JPEG format is a lossy format that is usually used for photographic images. If you
convert a file from its source PNM format to JPEG and then back to PNM, the resultant PNM will not be
identical to the original source PNM.
To convert image files interactively, use the GIMP to open the image, and then choose Save as
from the File menu, and select the file type to use; see Section 18.3 [Editing Images with the GIMP],
page 198.
The GIMP (GNU Image Manipulation Program) is an all-encompassing image-editing and manipulation
program that lets you paint, draw, create, and edit images in complex ways. Using gimp you can also
convert image files, retouch and edit photographic images, and browse collections of images.
The GIMP comes with hundreds of tools, filters, fonts, and other goodies installed. Here is a partial
list of its features:
Contains a full suite of painting tools, including Brush, Pencil, Airbrush, and Clone.
Supports custom brushes and patterns.
Includes a full suite of image selection, transformation, and manipulation tools, including a gradient
editor, color blending, and special effects.
Includes animation support.
Permits the use of layers and channels.
Allows for large images, with their size being limited only by available disk space.
Provides high-quality anti-aliasing.
Offers full alpha-channel support.
Supports command scripting.
Permits multiple undo and redo, limited only by available disk space.
Allows multiple images to be open simultaneously.
Supports all popular file formats, including GIF, JPEG, PNG, XPM, TIFF, TGA, MPEG, PS, PDF,
PCX, and BMP.
Allows the easy addition of more than 100 plug-ins for new file formats and new effect filters.
The GIMP runs under X and is started by running gimp or choosing it from your window managers
menu. When started, the GIMP looks like this:
NOTE: To learn the basics of the GIMP, consult The GIMP Users Manual and the other documentation
and resources on the Web at http://www.gimp.org/. You can also install the manual on your
system; it comes in the Debian gimp-manual package.
dia
Use dia to draw simple charts and diagrams. It saves files in its own format, but you
can export files to EPS (see Chapter 20 [PostScript], page 205); if you plan on editing a
diagram file again, however, be sure you keep the .dia file since, as of this writing,
dia cannot import EPS files.
Debian: dia
WWW: http://www.lysator.liu.se/alla/dia
electric
freedraft
FREEdraft is a 2-D mechanical CAD tool for precision drawing and sketching.
WWW: http://www.freeengineer.org/Freedraft/
gnuplot
ivtools
kali
Use kali for drawing patterns and tilings, including frieze patterns and infinite or
recursive tiles in the spirit of M.C. Escher.
Debian: kali
moonlight
The Moonlight Creator is an X client for modeling, illuminating, and rendering 3-D
scenes.
Debian: moonlight
WWW: http://www.cybersociety.com/moonlight/
sced
xfig
Use the venerable xfig application for drawing figurescomplex graphs, floor plans,
maps, flow charts, and so forth. It saves files in its own format (giving them a .fig
extension by default); the usual thing to do is export to EPS.
Debian: xfig
WWW: http://xfig.org/
xmorph
xmorph is a tool to morph (sometimes called warp) two images together, making
a new image in the process. Images must be in TrueVision Targa file format, with the
same size, shape, and number of pixels in each file (also see Section 18.1.8 [Morphing
Two Images Together], page 196).
Debian: xmorph
WWW: http://www.colorado-research.com/gourlay/software/
xpaint
xpaint, a simple paint tool that predates the GIMP, contains all of the basic features that you would expect from a paint program. If you dont need the GIMPs
advanced capabilities, consider using the smaller xpaint instead.
Debian: xpaint
WWW: http://www.danbbs.dk/torsten/xpaint/index.html
19 Importing Images
While you can always make your own images, you may sometimes want to import and use existing
images from other sources. In this chapter, Ill show how to import images from scanners and Kodak
PhotoCD discs. Well begin with recipes for taking screen shots.
When you specify a window, import captures only the windows contents; use the -frame option
to include the window manager frame in the image.
To capture a particular window, including its window manager frame, and write it to a PNG-format
file, first type:
$ import -frame session-1.png RET
Then, left-click on the window you want to capture.
NOTE: You must have superuser privileges to access these files (see Appendix A [Administrative Issues],
page 315).
Take the screen shot from a virtual console different from the one you want to take a shot of; if you
try to take it from the same console you want to capture, the command line you give will be included in
the shot! (Kind of like having your thumb in front of the lens while taking a photograph.)
Screenshots taken of virtual consoles, as shown here, are saved as text files; you cant take screen
shots of virtual consoles when graphics are displayed.
Astra 1220S
flatbed scanner
In this example, theres one scanning device on this system, a UMAX brand scanner that can be
specified to scanimage by giving its device name, umax:/dev/sgb, as an argument to the -d
option.
To list the available resolutions and options supported by a particular device, use the --help option
along with the -d option followed by its device name.
To list available options supported by the device listed in the previous example, type:
$ scanimage --help -d umax:/dev/sgb
RET
NOTE: For all scanimage commands, specify the scanner device you want to use by including the
-d option with the device name.
PGM
Grayscale images.
Use the --mode option to specify the format of the output, followed by one of the following
arguments: color for color PPM, gray for PGM grayscale, or lineart for black and white
PBM. Each scanner has a default mode; for most color scanners, the default mode will be color.
To make a 72 dpi scan of a color image 200 pixels wide and 100 pixels tall, using the UNIX scanner
from previous examples, and writing to a file called scan.ppm, type:
$ scanimage -d umax:/dev/sgb --resolution 72 -x 200 -y 100 >
scan.ppm RET
To make a 300 dpi scan of a black and white image 180 pixels wide and 225 pixels tall, using the
UMAX scanner from previous examples, and writing to a file called scan.pbm, type:
$ scanimage -d umax:/dev/sgb --resolution 300 --mode lineart
-x 180 -y 225 > scan.pbm RET
NOTE: The command lines in this recipe are split across two lines because theyre too long to fit on one,
but type these commands on one long line.
Once the image has been scanned and written to a file, you can edit it just as you would any image.
with the xpcd tool, then choose an image, extract a copy at the desired resolution, and save it to a file,
as described in Section 17.5 [Browsing PhotoCD Archives], page 187.
You can also use pcdtoppm on a PCD file directly to extract an image at a given resolution and save
it to a file in PPM format. Use the -r option to specify the resolution to extract, given as a numeric
argument from 1 (lowest resolution) to 5 (highest); if this option is omitted, a value of 3 is assumed. Also
give as arguments the name of the PCD file to read from and the name of the PPM file to write to.
To extract the highest resolution from the file slack.pcd and save it to a PPM file named
slack.ppm, type:
$ pcdtoppm -r5 slack.pcd slack.ppm RET
20 PostScript
Debian: gs
Debian: psutils
WWW: ftp://www.gnu.org/pub/gnu/ghostscript/
WWW: ftp://ftp.dcs.ed.ac.uk/pub/ajcd/
WWW: http://www.cappella.demon.co.uk/tinyfiles/tinymenu.html
PostScript is a programming language, used to describe the way a page (usually a physical sheet of
paper) should look. PostScript files are text files containing the PostScript commands for drawing images
to be printed on pages.
Like plain text files, PostScript files are commonly found on the Internet (and are used by commercial
printers) because, as with plain text, they can be shared across platforms and hardware without difficulty.
The same PostScript file can be output on a high-end display or printed on a low-end printer, to the best
of that hardwares capability. PostScript is a compact and elegant format.
While its possible to write directly in the PostScript language, and some people have become adept
at programming PostScript, so many tools and applications convert files to and from PostScript that you
dont have to. See Section 15.2 [Converting Plain Text for Output], page 159, for a way to convert plain
text into PostScript.
Ghostscript is a free implementation of the PostScript language. The gs tool is a Ghostscript interpreter that is used to convert files from PostScript to other formats, usually for printing to a non-PostScript
printer (see Section 25.3.1 [Preparing a PostScript File for Printing], page 241). The ghostview tool
is used to preview PostScript files on the screen (see Section 17.1.2 [Previewing a PostScript File],
page 183).
EPS, or Encapsulated PostScript, is a file format that describes the contents of a box within a page.
EPS files can be embedded in the page of a PostScript file, and are therefore commonly used when
inserting an illustration into a document (for example, all of the illustrations in the Cookbook are EPS
format files). You can view and print EPS files just as you would PostScript files.
This chapter includes recipes for formatting and manipulating PostScript files. Recipes are separated
according to whether they work on the individual, logical pages in a PostScript file (the numbered pages
in the file that are not necessarily the physical pages of output), and those that work on the entire file as
a whole.
Unless otherwise indicated, the tools in this chapter are part of Angus Duggans PSUtils package.
These tools can be useful for other purposes than those described below; see their respective man pages
for more details.
By default, dvips will output to the printer; to save the PostScript output to a file, give the file name
to be used for output with the -o option.
To output as PostScript the pages 137 to 146 of the file abstract.dvi to the file
abstract.ps, type:
$ dvips -pp137-146 -o abstract.ps abstract.dvi RET
To select page 47 from the PostScript file newsletter.ps and output it to the file
selection.ps, type:
$ psselect -p47 newsletter.ps selection.ps RET
To select the first ten pages, page 104, pages 23 through 28, and page 2 from the file
newsletter.ps and write it to the file selection.ps, type:
$ psselect -p1-10,104,23-28,2 newsletter.ps selection.ps RET
Use the -e option to select all even-numbered pages, and use the -o option to select all oddnumbered pages.
To select all of the even pages in the file newsletter.ps and write them to a new file,
even.ps, type:
$ psselect -e newsletter.ps even.ps RET
To select all of the odd pages in the file newsletter.ps and write them to a new file,
odd.ps, type:
$ psselect -o newsletter.ps odd.ps RET
Use an underscore (_) alone to insert a blank page, and use -r to output pages in reverse order.
To select the last ten pages of file newsletter.ps, followed by a blank page, followed by the
first ten pages, and output them to a new file, selection.ps, type:
$ psselect -p_1-_10,_,1-10 newsletter.ps selection.ps RET
To select the pages 59, 79, and 99 in the file newsletter.ps, and output them in reverse order
(with the 99th page first) to a new file, selection.ps, type:
$ psselect -p59,79,99 -r newsletter.ps selection.ps RET
NOTE: The same result as the preceding example above could have been done by omitting the -r
option and just listing the three pages in the reverse order:
$ psselect -p99,79,59 newsletter.ps selection.ps RET
To make a new PostScript file, double.ps, putting two pages from the file single.ps on
each page, type:
$ psnup -2 single.ps double.ps
RET
To specify the paper size, give the name of a standard paper size as an argument to the -p option:
a3, a4, a5, b5, letter, legal, tabloid, statement, executive, folio, quarto, or 10x14. You can also specify
any height and width with the -h and -w options; units can be specified in centimeters (followed by
cm) or inches (followed by in). If no size is specified, psnup assumes a paper size of a4.
Use the -l option when pages are in landscape orientation (rotated 90 degrees counter-clockwise
from portrait orientation), and -r when pages are in seascape orientation (rotated 90 degrees clockwise
from portrait orientation).
Pages are placed in row-major layout in the output file, where logical pages are placed in rows
across the page. Use the -c option to specify a column-major layout, where logical pages are placed
in columns down the page. Scale the size of the pages by giving a percentage to multiply the page size
by as an argument to the -s option; for example, -s .5 scales pages to 50 percent of their original
size.
To draw a border around each page, specify the borders width in points as an argument to the -d
option (if no width is specified, a value of 1 is assumed).
To rearrange the pages of file newsletter.ps into a signature and write it to the file
newsletter.bound.ps, type:
$ psbook newsletter.ps newsletter.bound.ps
RET
By default, psbook uses one signature for the entire file. If the file doesnt contain a multiple of four
pages, it adds blank pages to the end.
To specify the size of the signature to usein other words, the number of pages that will appear on
a single piece of papergive the number as an argument to the -s option. Signature size is always a
multiple of four.
To rearrange the pages of file newsletter.ps into an eight-sided signature and write it to
newsletter.bound.ps, type:
$ psbook -s8 newsletter.ps newsletter.bound.ps
RET
To resize the PostScript file double.ps to US letter-sized paper, writing output to a new file,
doublet.ps, type:
$ psresize -pletter double.ps doublet.ps RET
To merge the files slide1.ps, slide2.ps, and slide3.ps into a new PostScript file,
slideshow.ps, type:
$ psmerge -oslideshow.ps slide1.ps slide2.ps slide3.ps RET
NOTE: As of this writing, psmerge only works with PostScript files that were made with the same
applicationwhich means, for example, that you can merge multiple files made with TEX, or multiple
files made with xfig, but not a combination of the two.
Then, to print the booklet, you send odd.ps to the printer, load the printed pages in the manual
feed tray and then send even.ps to the printer. This prints the odd and even pages on opposite sides
of the sheets.
To make a double-sized booklet on letter-sized paper in landscape orientation, from a file using
letter-sized portrait orientation, type:
$ psbook input.ps > temp1.ps RET
...processing messages...
$ psnup -l -pletter -2 -s.7 temp1.ps > temp2.ps
...processing messages...
$ pstops "2:0(1in,0in)" temp2.ps > odd.ps RET
...processing messages...
$ pstops "2:-1(1in,0in)" test2.ps > even.ps RET
...processing messages...
$
RET
This command writes a new file in PDF format called sutra.pdf. The original file, sutra.ps,
is not altered.
NOTE: To make proper PDF conversions, make sure that you have gs version 6.01 or higher installed;
use the -v option with gs to output the installed version.
This command writes a text file called sutra.txt. The original file, sutra.ps, is not altered.
21 Sound Files
Debian: alsa-base
WWW: http://www.alsa-project.org/
This chapter covers the basic control of audio on Linux-based systems, including how to adjust the audio
mixer and how to play and record sound files using basic tools. You can also play and record audio with
snd (see Chapter 23 [Editing Sound Files], page 225) and many other sound applications.
For purposes of this discussion, I will assume you are using the ALSA sound driver on your system
and that you have sound working properly; unlike the standard Open Sound System driver (OSS/Linux),
the ALSA driver is made entirely of free software. It is becoming the de facto choice for musicians who
use Linux.
NOTE: Most systems come configured so that you must be the superuser to be able to use sound devices,
including audio CDs. If this is the case on your system, ask your administrator to give you access to
these devices, typically by adding you to the audio group (see Section 6.1 [Groups and How to Work
in Them], page 75).
.cdda or .cdr
Both are names for the audio compact disc format, used for burning
audio CD-Rs and CD-RWs (44.1 KHz raw stereo).
.gsm
.midi or .mid
.mod
MOD file.
.mp3
.ra
RealAudio file.
.raw
.sf
.voc
.wav
The following table describes some of the important sound groups that amixer lists.
D ESCRIPTION
S OUND G ROUP
Master
The master volume settings.
PCM
Digital audio for playing sound files; the first channel is group PCM,0
and the second is PCM,1.
CD
The audio compact disc player (a cable must be connected from the
CD-ROM drive to the sound card).
Synth
Line
The sound input device (the jack on the back of the soundcard is usually labeled LINE IN).
The microphone device (the jack on the back of the soundcard is usually labeled MIC).
To list the settings for only one group, use the get option followed by the name of the group you
want to list. Group names are case sensitiveso giving MIC specifies the microphone group, while Mic
and mic are not valid groups.
To output the microphone settings, type:
$ amixer get MIC RET
To output the second PCM settings, type:
$ amixer get PCM,1 RET
MIC
NOTE: You can have only one group selected for capture at a time, and when you select a group as an
input source for recording, you are simply turning the microphone or other input on; recording does not
occur until you use a recording tool.
NOTE: Before you begin playing sound, make sure youve set the master and PCM volume levels with
the mixer (see Section 21.2 [Adjusting the Audio Controls], page 213). The most common reason for no
sound being produced when you try to play sound is not having the volume turned up!
ALSA comes with aplay, a tool for playing sound files that is similar to play, but does not recognize as many formats.
To buffer the audio, useful for when the system is running many processes or otherwise has a lot of
activity, give a buffer size, in kilobytes, as an argument to the -b option. The default is 0 (no buffer); if
you need this option, use a size of at least 1024KB (which is 1MB), or about six seconds of MP3 audio.
You can also use mpg321 to play streaming MP3 audio from the Web; just give the URL of the
MP3 stream as an argument.
NOTE: The mpg321 tool is a free software replacement of mpg123, another command-line MP3 player
that is not free software.
But there are a great many other MP3 players available; some of them are listed in Section 21.5 [Other
Sound File Tools], page 217.
If you have a non-MIDI sound card, you can still play MIDI files by giving the -f option, which
sends the MIDI output to the FM synthesizer on the sound card, which in turn plays it using FM patches
that come with the playmidi distribution.
To play the MIDI file copa-cabana.mid on a non-MIDI sound card, type:
$ playmidi -f copa-cabana.mid RET
This command begins an 8,000 Hz, monaural 8-bit WAV recording to the file hello.wav, and
keeps recording until you interrupt it with C-c. While the default is to make a low-fidelity recording
8,000 Hz, monaural 8-bit samplesyou can specify that a high-fidelity recording be made. (But remember that high-fidelity recordings take up much more disk space.)
To make a stereo recording, use the -c option to specify the number of channels, giving 2 as the
argument. To make a 16-bit recording, give w (wide) as the argument to the -s (sample size)
option.
Set the recording sample rate by giving the samples per second to use as an argument to the -r
option. For CD-quality audio at 44,100Hz, use -r 44100.
Finally, to record a file in a particular format, either give the name of the format as an argument to
the -f option, or use the traditional file name extension for that format in the output file name (see
Section 21.1 [Sound File Formats], page 213).
To make a high-fidelity recording from the microphone and save it to a WAV-format file called
goodbye.wav, type:
$ rec -s w -c 2 -r 44100 goodbye.wav RET
To make a sound recording in the CD audio format, and write the output to a file called
goodbye.cdr, type:
$ rec goodbye.cdr RET
NOTE: When youre not recording sound, keep the inputs muted (see Section 21.2.3 [Muting an Audio
Device], page 214); this way, you can have a microphone plugged in without having feedback when
playing sounds. Also, make sure the volume levels are not set too high or too low when recording;
getting the right level for your microphone or other input device may take some initial adjustment.
Like play, rec is part of the sox toolkit.
A popular audio sound file player for X, the Free Audio Music Player can play
MP3 and Ogg Vorbis formats, and its graphical appearance can be changed with
themes.
Debian: freeamp
WWW: http://www.freeamp.org/
maplay
An MP3 player.
Debian: maplay
mp3asm
Use this tool to cut and paste MP3 frames and fix broken MP3 files.
Debian: mp3asm
WWW: http://packages.debian.org/stable/sound/mp3asm.html
xmms
To begin with a particular track, give the number of the track as an argument.
To play an audio CD, beginning with the third track, type:
$ cdplay 3 RET
To end with a particular track, give the number of the track as a second argument.
To play an audio CD, beginning with the first track and ending with the fourth track, type:
$ cdplay 1 4 RET
To play only the third track of an audio CD, type:
$ cdplay 3 3 RET
Use cdplay to start playback at the point where it was paused; to restart the playback from the
beginning, use cdplay with x as an argument.
To restart a paused CD, type:
$ cdplay RET
To restart a paused CD from the beginning, type:
$ cdplay x RET
RET
For the current status of the audio CD in the CD-ROM drive, type:
$ cdinfo RET
In addition, cdinfo recognizes the following options:
O PTION
-a
D ESCRIPTION
Output the absolute disc time.
-r
-s
-t
- 43:14 in 8 tracks
1
2
3
4
5
6
7
8
In this example, the CD contains eight tracks, with a total of 43 minutes and 14 seconds play time.
NOTE: This command will also eject a CD-ROM (data CD), if the CD-ROM is not currently mounted
(see Section 24.4 [CD-ROMs], page 236).
For more reliable sampling, use cdparanoia. Give the range of audio tracks to sample as an
argument (with no arguments, it samples the entire disc). Use the -w option to specify WAV format
output.
To sample the third track from a scratched audio CD in the default CD-ROM drive using paranoid
data verification, and write the output to a WAV format file in the current directory, type:
$ cdparanoia -w 3-3 RET
To sample the entire audio CD using paranoid data verification, type:
$ cdparanoia -w -B RET
To sample the entire audio CD using less-than-maximum paranoid data verification, without
checking for scratches, and saving each song as a separate raw audio-format file in the current
directory, type:
$ cdparanoia -B -Y -X RET
NOTE: Sampling an entire audio CD can use a lot of disk space; most people delete the .cdr or
.wav files as soon as they make MP3s or burn an audio CD-R from the data.
When you use wildcards for files, as in the second-to-the-last example, the shell expands the files in
alphabetical order. To write a group of tracks in a particular order without specifying all of their names
as arguments, rename them so that their names begin with numbers that correspond to the order you want
to write them in (see Section 5.5 [Moving Files and Directories], page 68).
For example, if you have the three files morning-song.cdr, midday-song.cdr,
and evening-song.cdr, and you want to write them in that order, rename the files to
01-morning-song.cdr, 02-midday-song.cdr, and 03-evening-song.cdr;
otherwise, if you specify them as *.cdr, the shell will sort their names so that they will
be written to CD-R in the order of evening-song.cdr, midday-song.cdr, and
morning-song.cdrexactly the opposite of what was intended!
To write a disc containing both data and audio tracks, first specify the file for the data track (it
should contain a filesystem image in either ISO 9660 or Rock Ridge format), and then follow it with the
-audio option and the names of the audio tracks to use. The resulting CD-R will be both mountable
as a data CD and playable on audio CD players (the first track on the disc, the data track, will be skipped
when playing the audio).
You can also use this tool with a CD-RW drive and write to a CD-RW disc.
To burn the data track band-info and all the audio tracks in the current directory with a
.cdda extension to the CD-R drive whose target ID is 2 on the primary SCSI bus, type:
$ cdrecord dev=0,2,0 band-info -audio *.cdda RET
NOTE: When writing an audio CD, you should have as few processes running as possible. If cdrecord
has to pause even momentarily to let the system shuffle other processes, the CD-R could be ruined! For
this reason, it is advisable to avoid switching between consolesor between windows, if running X
during the CD-R burning process.
workman
A tool for playing audio CDs, with a graphical interface that looks like the front
panel of a physical CD player.
xcdroast
Making a selection of a sound file in snd is similar to selecting text in Emacs; you can mark a section
of a sound file or recording youve made in Snd by left-clicking and dragging across the area with the
mouse. The area you drag across becomes shaded and is called the selection. Once you select a portion
of the sound, any effect you choose works on that selection. You can also cut and paste selections of the
sound you are editing into other sound buffers.
The xwave tool (and many others, no doubt) have similar capabilities and functions (see Section 23.4
[Other Tools for Sound Editing], page 230).
To raise the volume of file old.wav twofold and write the output to new.wav, type:
$ sox -v3 old.wav new.wav RET
To lower the volume of file old.wav by half and write the output to new.wav, type:
$ sox -v.5 old.wav new.wav
RET
Use sox with the stat option and -v to determine the largest possible value that can be used
before distortion or clipping occurs (it performs a statistical analysis on the file and outputs a numeric
value). This value comes in handy when you want to raise a files volume as high as possible without
ruining its fidelity.
To raise the volume of the file quit.cdr as high as possible without distortion, type:
$ sox quiet.cdr loud.cdr stat -v RET
3.125
$ sox -v 3.125 quiet.cdr loud.cdr RET
$
NOTE: This last example makes a sound similar to some of the recordings of the band Flying Saucer
Attack. You know who they are, dont you?)
NOTE: The echos effect works like echo, but adds a sequence of echos to the sound file.
This command writes a new file, new.cdr, in the audio CD format; the original file, new.wav,
is not altered.
You may sometimes need to specify additional options, such as with raw audio files where the sampling rate and other properties must be specified.
To convert all of the raw audio files in the current directory to audio CD format files, type:
$ for i in *.raw RET
{ RET
sox -s -w -c2 -r 44100 $i -x $i.cdr RET
} RET
This command writes all of the .raw files to new files of the same name but with a .cdr extension. You could then use cdrecord to burn an audio CD with the .cdr files (see Section 22.3
[Writing an Audio CD-R], page 222).
To convert a file to a particular format without using the standard extension, specify the format to
write to with the -t option.
To convert the file new.wav to the audio CD format and write output to a file named
cd-single, type:
$ sox new.wav -t cdr cd-single RET
It usually takes some time to encode an MP3 file; when notlame is encoding a file, it continually
outputs the current percentage of completion.
NOTE: Scripts on the download site show how to encode multiple WAV files and how to decode all of
the tracks on an audio CD.
Ogg Vorbis is one such format; see http://www.vorbis.com/.
gramofile
Use GramoFile for sampling sound from vinyl records. It can remove ticks and
pops from the sound using filters and signal processing, and is frequently used to
copy records onto CD-Rs.
Debian: gramofile
WWW: http://panic.et.tudelft.nl/costar/gramofile/
mxv
xwave
XWave is a simple sound editor that contains the basic functions you would expect in a WAV file editor.
WWW: http://www.ibiblio.org/pub/Linux/apps/sound/editors/
24 Disk Storage
All files and directories on a Linux-based system are stored on a Linux filesystem, which is a disk device
(such as a hard drive) that is formatted to store a directory tree (see Chapter 5 [Files and Directories],
page 59).
There are two kinds of disk storage on a Linux system: fixed and removable. Fixed storage refers
to a disk that is firmly attached to the computer system, and is not intended for casual removal (except
when upgrading). Your hard drive (sometimes called hard disk), used to store the operating system,
application software, and user data, is the prime example of a fixed disk.
The second kind of disk storage is removable storage, disks that are intended to be removed for
archiving or transfer to another system. Common examples of removable storage are floppy disk (or
diskette) and CD-ROM drives, where you typically remove the storage media from its drive bay when
youre done using it.
On Linux systems, disks are used by mounting them to a directory, which makes the directory tree
the disk contains available at that given directory mount point. Disks can be mounted on any directory
on the system, but any divisions between disks are transparentso a system which has, aside from
the root filesystem disk mounted on /, separate physical hard disks for the /home, /usr, and
/usr/local directory trees will look and feel no different from the system that only has one physical
disk.
System administrators often mount high-capacity drives on directory trees that will contain a lot of
data (such as a /home directory tree on a system with a lot of users), and for purposes of fault tolerance,
administrators often use several physical hard disks on one systemif there is a disk failure, only the
data in that disk is lost.
This chapter describes tools and techniques for manipulating disks and storage media.
$ df RET
Filesystem
/dev/hda1
/dev/hda2
/dev/hdb1
$
This example shows that three filesystems are mounted on the systemthe filesystem mounted on /
is at 23 percent capacity, the filesystem mounted on /usr is at 26 percent capacity, and the filesystem
mounted on /home/webb, a home directory, is at 87 percent capacity.
To output the disk usage for the directory tree whose root is the current directory, type:
$ du
8
12
4
24
3
27
$
RET
./projects/documentation
./projects/source
./projects/etc
./projects
./tmp
.
This example shows two subdirectories in the directory tree: projects and tmp; projects
contains three additional directories. The amount of disk space used by the individual directories is the
total on the last line, 27K.
By default, output is in 1K blocks, but you can specify another unit to use as an option: -k for
kilobytes and -m for megabytes.
To output the disk usage, in kilobytes, of the /usr/local directory tree, type:
$ du -k /usr/local RET
To show the number of megabytes used by the file /tmp/cache, type:
$ du -m /tmp/cache RET
Use the -s option (summarize) to output only the last line containing the total for the entire
directory tree. This is useful when you are only interested in the total disk usage of a directory tree.
To output only the total disk usage of the /usr/local directory tree, type:
$ du -s /usr/local RET
To output only the total disk usage, in kilobytes, of the /usr/local directory tree, type:
$ du -s -k /usr/local RET
RET
RET
To mount a floppy to a specific directory, use mount and give as arguments the device name of the
floppy drive (usually /dev/fd0 for one-floppy systems) and the name of the directory to mount to.
RET
Once you have mounted a floppy, its contents appear in the directory you specify, and you can use
any file command on them.
To list the contents of the base directory of the floppy mounted on /floppy, type:
$ ls /floppy RET
To list the contents of the entire directory tree on the floppy mounted on /floppy, type:
$ ls -lR /floppy
RET
NOTE: You can copy files to and from the directory tree that the floppy is mounted on, make and remove
directories, and do anything else you could on any other directory tree. But remember, before you remove
it, you must first unmount it.
RET
NOTE: You cant unmount a disk if your current working directory, the directory you are in, is somewhere in that disks directory tree. In this case, trying to unmount the disk will give the error that the
/floppy filesystem is in use; change to a different directory that isnt in the /floppy directory
tree, and then you can unmount the disk.
Sometimes when you unmount a floppy, the light on the floppy drive will go on and remain on for
a few seconds after it has been unmounted. This is because Linux sometimes keeps changes to files in
memory before it writes them to disk; its making sure that the files on the floppy are up-to-date. Simply
wait until the light goes off before you remove the floppy from the drive.
This works if your administrator has set up the floppy drive filesystem for user accesssee Section A.3.2 [Letting Users
This is sometimes called being under the mount point of the disk.
24.4 CD-ROMs
As with a floppy disk, before you can use a data CD (compact disc) on your system, you must first mount
it on an empty directory. You then unmount it from the directory before you can eject the CD from the
CD-ROM drive (you can also eject the disc using softwaresee Section 22.1.6 [Ejecting an Audio CD],
page 221).
NOTE: To use audio CDs, see Chapter 22 [Audio Compact Discs], page 219.
This command makes the contents of the CD-ROM available from the /cdrom directory tree. You
can use any Linux file command on the files and directories on a CD-ROM, but you cant write to a
CD-ROMthe CD-ROM format is read-only, so you can read the disc but not write to it.
Like the /floppy directory, the use of the /cdrom directory is a standard practice and convenient, but not necessaryyou can mount disks in whatever empty directory you like. (You could even,
for example, mount discs from the CD-ROM drive to /floppy and mount floppy disks to /cdrom,
but why would anyone do that!)
To mount a CD-ROM to a specific directory, use mount and give as arguments the name of the
device file in /dev corresponding to the CD-ROM drive, and the name of the directory to mount to.
This directory must already exist on the filesystem, and must be empty. If it doesnt exist, use mkdir to
create it first (see Section 5.1.2 [Making a Directory], page 62).
Most Linux systems are set up so that the device file of the first CD-ROM drive is /dev/cdrom,
but the name of the device file may be different, especially if you have a SCSI CD-ROM drive.
To mount the disc in the CD-ROM drive to the /usr/local/share/clipart directory, type:
$ mount /dev/cdrom /usr/local/share/clipart RET
The contents of the disc in the CD-ROM drive will then be available in the
/usr/local/share/clipart directory tree, and you can then use the files and
directories on the CD-ROM as you would any other files. For example:
To peruse a directory tree graph of the CD-ROMs contents, type:
$ tree /usr/local/share/clipart | less RET
To change to the root directory of the CD-ROM, type:
$ cd /usr/local/share/clipart RET
To list the contents of the root directory of the CD-ROM, type:
$ ls /usr/local/share/clipart RET
NOTE: As with unmounting any kind of filesystem, make sure that none of the files on the disc are
in use, or you wont be able to unmount it. For example, if the current working directory in a shell is
somewhere inside the /cdrom directory tree, you wont be able to unmount the CD-ROM until you
change to a different directory.
This works if your administrator has set up the CD-ROM drive filesystem for user accesssee Section A.3.2 [Letting Users
25 Printing
Debian: magicfilter
The usual way to print on a Linux system is to send a print job to the printer with lpr, as described
below in Section 25.1.1 [Sending a Print Job to the Printer], page 237.
But you dont always send a file straight to the printersometimes you may want to add special
things to it before you print it, such as headers or graphic trim. For example, you might want to split a
text file into pages and add a header to the top of each page containing the file name and page number;
all of this is described in Chapter 13 [Formatting Text], page 139.
Sometimes you may need to convert or otherwise prepare a file so that it can be printed on your
particular printer, since not all print hardware can print the same kinds of file formats. Recipes in this
chapter show how to do this, such as how to convert PostScript files so that they will print properly on a
non-PostScript printer (see Section 25.3 [Preparing Files for Printing], page 240).
This chapter also shows how to format PostScript files for printing. To convert plain text to PostScript
and enhance it for printing, by adding fonts, graphic headers, and the like, see Section 15.2 [Converting
Plain Text for Output], page 159.
And this chapter isnt in the files section, because you can print things that arent in a filefor
example, you can pipe the output of another tool or series of tools to lpr, and it will spool that command
output to the printer. This usage is actually very common.
NOTE: When a printer is properly configured on Linux, it is a pleasure to use, but a misconfigured
printer can lead to all kinds of troubleincluding the dreaded staircase effect, where a text file prints
with each subsequent line of output offset to the right by the length of the previous line.
If print services havent been configured yet on your system, I strongly recommend that the
magicfilter package be installed; it includes filters for the automatic detection of file typeswhen
you print a file, it automatically converts it to the proper format for your printer.
Comprehensive details on the setup of printer resources can be found in both the Printing HOWTO
and the Printing Usage HOWTO (see Section 2.8.6 [Reading System Documentation and Help Files],
page 31).
If you have more than one printer connected to your system, specify the printer to send to as an
argument to the -P option. (Printers have names just as user accounts and hosts do, and it is the
administrators privilege to name them; the default printer is usually called lp, for line printer.)
To send the file nightly-report to the printer called bossomatic, type:
$ lpr -P bossomatic nightly-report RET
NOTE: The name of the lpr tool comes from line printer, which was the kind of printer hardware in
popular use back when this program was first developed.
$ lpq RET
lp is ready and printing
Rank
Owner
Job Files
active groucho
83
cigar.ps
1st
harpo
84
harp.ps
2nd
chico
85
love.ps
$
Total Size
1739030 bytes
499 bytes
45576 bytes
In this example, there are three jobs queued for the default printerone by user groucho, for the
file cigar.ps, one by user harpo, for the file harp.ps, and one by user chico, who has printed
a file called love.ps.
The job by user groucho is the active job ; this is the job that is currently printing on the printer.
The other jobs must wait until this file is finished printing, and then they print in rank order.
As with lpr, you can specify the name of a printer as an argument to the -P option.
To view the spool queue for the printer called bossomatic, type:
$ lpq -P bossomatic RET
To only list the jobs for a particular user, give the name of the user as an argument.
To list the print jobs for user harpo, type:
$ lpq harpo RET
NOTE: When there are no print jobs, lpq outputs the text no entries.
To cancel all of your print jobs in the spool queue, use a hyphen instead of the number of a print job.
To cancel all of your print jobs, type:
$ lprm - RET
NOTE: If you try to cancel an active jobone that has already been spooled to the printerdont be
alarmed if some pages still print; the printer probably has some of the job in its internal print buffer. To
stop the printing in a case like this, take the printer offline, reset it, and then put it back online again
(usually, the printer will have buttons for these commands on its front control panel).
The following table lists some of dvipss various options for controlling print output.
D ESCRIPTION
O PTION
-A
Print only odd-numbered pages (DVI file must have been generated by
TEX).
-B
Print only even-numbered pages (DVI file must have been generated
by TEX).
-b copies
-k
-l last
-m
-p first
-r
-t format
NOTE: You can also print DVI files with lpr using the -d option.
$ gs -? RET
GNU Ghostscript 5.10 (1998-12-17)
...more output messages...
Input formats: PostScript PostScriptLevel1 PostScriptLevel2 PDF
Available devices:
x11 x11alpha x11cmyk x11gray2 x11mono lvga256 vgalib
t4693d8 tek4696 appledmp ccr lp2563 lbp8 lips3 m8510
oki182 okiibm la50 la70 la75 la75plus sxlcrt deskjet
djet500 laserjet ljetplus ljet2p ljet3 ljet4 declj250
cdeskjet cdjcolor cdjmono cdj550 cdj500 djet500c
hpdj uniprint epson eps9mid eps9high epsonc lq850
ap3250 ibmpro bj10e bj200 bjc600 bjc800 ljet3d faxg3
faxg32d faxg4 dfaxhigh dfaxlow pcxmono pcxgray pbm
pbmraw pgm pgmraw pgnm pgnmraw pnm pnmraw ppm ppmraw
pkm pkmraw tiffcrle tiffg3 tiffg32d tiffg4 psmono
psgray jpeg
...more output messages...
$
A typical gs installation can write to more than 100 different print devices, including HP LaserJet 4
printers (ljet4), HP Color DeskJets (cdeskjet), and Group 4 fax (tiffg4). Newer versions
of gs will have better support for newer printers, so make sure that you have a recent version installed if
you have a new model printer.
gs takes the file to convert as an argument; give the device to write output for as an argument to the
-sDEVICE= option, and give the name of the file to write to as an argument to the -sOutputFile=
option.
Two additional options are commonly used: -dSAFER, which prevents the accidental deleting or
overwriting of files, and -dNOPAUSE, which turns off the pause between pages.
When the conversion is complete, you will be at the gs prompt; type quit to exit.
To convert the file tiger.ps to a format suitable for printing on an HP Color DeskJet 500
printer, type:
$ gs -sDEVICE=cdj500 -sOutputFile=tiger.dj -dSAFER -dNOPAUSE
tiger.ps < /dev/null RET
This command writes the output to a file, tiger.dj, which you can spool as a print job with lpr
to print.
Debian: tetex-bin
WWW: http://www.radicaleye.com/dvips/
To convert a file from DVI format to PostScript, use dvips. It takes the file to convert as an argument;
give the name of the PostScript file to write to as an argument to the -o option.
To convert the file abstract.dvi to PostScript, type:
$ dvips -o abstract.ps abstract.dvi RET
This command reads the DVI file abstract.dvi and writes a PostScript version of it to the file
abstract.ps; the original file is not altered.
To write only certain pages of a DVI file to the PostScript output, give the page or pages as arguments
to the -pp option.
To output only pages 14 and 36 from file abstract.dvi to a PostScript file, abstract.ps,
type:
$ dvips -pp14,36 -o abstract.ps abstract.dvi RET
To output pages 2 through 100 from file abstract.dvi to a PostScript file, abstract.ps,
type:
$ dvips -pp2-100 -o abstract.ps abstract.dvi RET
To output page 1 and pages 5 through 20 from file abstract.dvi to a PostScript file,
abstract.ps, type:
$ dvips -pp1,5-20 -o abstract.ps abstract.dvi RET
To specify an output paper size, give it as an argument to the -t option; if you have a PostScript
printer, you can also send the output directly to the printer (see Section 25.2.2 [Printing with Dvips],
page 240).
To output the file abstract.dvi as a PostScript file, abstract.ps, with a paper size of
legal, type:
$ dvips -t legal -o abstract.ps abstract.dvi RET
To print the file abstract.dvi to the default printer in landscape mode, type:
$ dvips -t landscape abstract.dvi RET
NOTE: This conversion is not only useful for print preparation. Once the DVI file is converted to
PostScript, you can then convert the PostScript to other formats, such as plain text or PDFsee Section 20.3 [Converting PostScript], page 209.
Use the -P option with dvips to specify the printer name to write output touse this option
to make output for non-PostScript printers. For example, to convert TEX and LaTeX files to PDF, use
dvips and give pdf as an argument to the -P option.
To generate a PDF file from the DVI file abstract.dvi, type:
$ dvips -Ppdf -o abstract.pdf abstract.dvi RET
The first way is to view the file in xpdf (the PDF file viewer), and then left-click the printer icon.
This wont actually send the file to the printer, but it writes a PostScript file in the same directory, with
the same base file name as the PDF file but with a .ps extension. You can then print this file with lpr
or convert it to another format (see Section 25.3.1 [Preparing a PostScript File for Printing], page 241).
The second way is to use pdf2ps, part of the gs package, to convert the PDF file to PostScript
(then print the PostScript output as described for xpdf above). pdf2ps takes two arguments: the name
of the PDF file to convert, and the name of the PostScript file to write to.
To convert the PDF file pricelist.pdf, type:
$ pdf2ps pricelist.pdf pricelist.ps RET
In the preceding example, you can then use gs to convert the file to a format your non-PostScript
printer understands (see Section 25.3.1 [Preparing a PostScript File for Printing], page 241).
NOTE: A manual page can actually contain more than one physical page; the output will have as many
pages as necessary to print it.
26 Cross-Platform Conversions
Sometimes, its inevitablethrough no choice of your own, you must deal with a disk from another
operating system, or a file with data stored in a proprietary format from one of these systems.
The recipes in this chapter are about converting data from other platformsreading disks from DOS,
Windows, and MacOS systems, and converting DOS text and Microsoft Word files.
To format the floppy disk in the primary floppy drive so that it can be used with MS-DOS, type:
$ mformat a:
RET
NOTE: If you want to use a floppy disk with your Linux system and dont need DOS compatibility, dont
bother using this MS-DOS formatthe native Linux format is much more efficient (see Section 24.3.1
[Formatting a Floppy Disk], page 235). If you know how long a DOS format takes, youll be amazed at
how much faster the Linux format is, tooit will do it so fast youll think it didnt work!
To introduce the floppy disk in the first floppy drive as an HFS volume for the hfsutils, type:
$ hmount /dev/fd0
RET
After you run this command, the other tools in the hfsutils package will work on the Macintosh
disk in the first floppy drive.
RET
RET
To copy a file from a Mac disk, give the name of the directory and file to copy as a quoted argument,
and the name of the target directory to copy to.
To copy the file Desktop Folder:Readme from the current Mac disk to the current directory,
type:
$ hcopy Desktop Folder:Readme . RET
If the disk currently has a partition on it, this command wont work; use the -f option to force the
format, thus erasing any existing partition and data the disk contains.
Give a label for the drive as a quoted argument to the -l option. The label name cant contain a
colon character (:).
To format the disk in the first floppy drive with a Mac HFS filesystem, overwriting any existing Mac
filesystem, type:
$ hformat -f /dev/fd0 RET
To format the disk in the second floppy drive with a Mac HFS filesystem, giving it a volume label
of Work Disk, type:
$ hformat -l Work Disk /dev/fd1 RET
When a disk has multiple partitions, give the number of the partition to format as an additional
argument. To format the entire medium, give 0 as the partition to use.
To format the second partition of the SCSI disk at /dev/sd2 with a Mac HFS filesystem, type:
$ hformat /dev/sd2 2 RET
To format the entire SCSI disk at /dev/sd2 with a Mac HFS filesystem, overwriting any existing
Mac filesystem and giving it a label of Joes Work Disk, type:
$ hformat -f -l "Joes Work Disk" /dev/sd2 0 RET
NOTE: Both commands directly write to the files you specify. To make a backup of the original file, use
the -b option; before the conversion, this writes a copy of each specified file with a .bak file name
extension.
NOTE: While word2x does a pretty good job of conversion, it wont convert any pictures embedded in
Word documents.
Another way to read Word files is to import them into the AbiWord or StarWriter word processors
(see Section 15.6 [Other Word Processors and Typesetting Systems], page 173).
This command writes a new file, resume.ltx, in the LaTeX format; you can then view, print, or
convert the file to other formatssee Section 15.4.3 [Processing LaTeX Files], page 168. The original
resume.doc file is unaltered.
To convert all of the .DOC Word files in the current directory to LaTeX files with maximum line
widths of 40 characters, type:
$ word2x -f latex -w 40 *.DOC RET
To send a conversion to the standard output, give a hyphen character, -, as the output file to use.
This is useful for piping the plain text conversion to other tools that work on text, such as grep, a tool
for searching text (see Section 14.1 [Searching for a Word or Phrase], page 147).
To search the text of the Word file resume.doc for the string linux regardless of case, type:
$ word2x resume.doc - | grep -i linux RET
These commands convert the Word file resume.doc to text, and output all lines of that text, if
any, that contain the string linux regardless of case. The original resume.doc file is unaltered.
27 Reminders
If youre working on a system on a regular basis, it can be very useful to have the system remind you when
you should be doing something else. This chapter describes software tools that provide reminders
clocks, calendars, address books, and tools for tracking appointments.
$ date RET
Fri May 11 11:10:29 EDT 2001
$
The default format of the output is to display the day of the week; the month name; the day of the
month; the 24-hour time in hours, minutes, and seconds; the time zone; and the year.
Use the -u option to output the current date and time in Greenwich Mean Time (also known as
Coordinated Universal Time, or UTC).
To output the current date and time in UTC, type:
$ date -u RET
Fri May 11 15:10:29 UTC 2001
$
Use the -R option to output the date in the format described in RFC822 (see Section 11.4 [Word
Lists and Reference Files], page 130): day of week followed by day of month, month name, year, time,
and time zone in numeric format. This is the date format used in email messages.
To output the current date and time in RFC822 format, type:
$ date -R RET
Fri, 11 May 2001 11:10:29 -0400
$
You can also use the -d option to specify the precise fields to output, and the order in which to
output them. One useful example is given next; for more information, see the date man page (see
Section 2.8.4 [Reading a Page from the System Manual], page 28).
To output the number of days into the year for a particular date, use -d with DD MMM +%j,
where DD is the day of month and MMM is the name of month.
To output the numeric day of the year that 21 June falls on in the current year, type:
RET
This command outputs the number 172, which indicates that 21 June of the current year is the 172nd
day of the current calendar year.
NOTE: To ensure that the time on your system clock remains as accurate as possible, your system
administrator should install the chrony package; it periodically adjusts the time on the system clock
according to measurements obtained from other servers on the Internet via Network Time Protocol.
Use the saytime command to output the current system time in an audible message in a male voice.
You must have a sound card installed on your system, and it must be set up with speakers or some other
output mechanism at an appropriate volume level in order for you to hear it (see Section 21.2 [Adjusting
the Audio Controls], page 213).
RET
NOTE: If youre feeling adventurous, you can record another voicelike your ownand use that
voice instead of the default voice; the sound files used are Sun .au files and are kept in the
/usr/share/saytime directory.
27.3 Calendars
The following recipes describe a few of the basic tools for displaying calendars in Linux.
RET
To output a calendar for a specific year, give just the year as an option.
$ cal 2001
RET
2001
S
7
14
21
28
M
1
8
15
22
29
January
Tu W Th F S
2 3 4 5 6
9 10 11 12 13
16 17 18 19 20
23 24 25 26 27
30 31
April
S M Tu W Th F S
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30
July
S M Tu W Th F S
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30 31
S
7
14
21
28
M
1
8
15
22
29
October
Tu W Th F S
2 3 4 5 6
9 10 11 12 13
16 17 18 19 20
23 24 25 26 27
30 31
S
4
11
18
25
S
6
13
20
27
S
5
12
19
26
February
M Tu W Th F S
1 2 3
5 6 7 8 9 10
12 13 14 15 16 17
19 20 21 22 23 24
26 27 28
May
M Tu W
1 2
7 8 9
14 15 16
21 22 23
28 29 30
Th F S
3 4 5
10 11 12
17 18 19
24 25 26
31
August
M Tu W Th
1 2
6 7 8 9
13 14 15 16
20 21 22 23
27 28 29 30
4 5
11 12
18 19
25 26
F S
3 4
10 11
17 18
24 25
31
November
Tu W Th F S
1 2 3
6 7 8 9 10
13 14 15 16 17
20 21 22 23 24
27 28 29 30
S
4
11
18
25
March
M Tu W Th F S
1 2 3
5 6 7 8 9 10
12 13 14 15 16 17
19 20 21 22 23 24
26 27 28 29 30 31
M Tu
June
W Th
3 4 5 6 7
10 11 12 13 14
17 18 19 20 21
24 25 26 27 28
September
M Tu W Th
2
9
16
23
30
3 4 5 6 7
10 11 12 13 14
17 18 19 20 21
24 25 26 27 28
31
So, to print out a calendar for the current year to the default printer, type:
cal -y | lpr
RET
To output a calendar for a specific month, give both the numeric month and year as arguments.
S
1
8
15
22
29
S
1
8
15
22
29
$ cal -y
2 3 4 5 6 7
9 10 11 12 13 14
16 17 18 19 20 21
23 24 25 26 27 28
30
December
S M Tu W Th F
F S
1 2
8 9
15 16
22 23
29 30
S
1
8
15
22
29
BKSP BKSP
RET
10
RET
NOTE: When you display a calendar for a specific month and year, Emacs fills in the current year in the
minibuffer; in the example above, the current year was 2001, and BKSP was typed twice to erase the last
two digits, which were replaced with 10 to make it the year 2010.
$ calendar RET
6/16
Finish draft of book
Party at Jacks
Fri
Lunch with Kim and Jo, 12:30
Mon
Book manuscript due
$
The calendar tool reportedly first appeared in Version 7 of AT&T UNIX, and was rewritten
early on for the BSD family of Unix. While the BSD derivate is available for Debian as part of the
bsdmainutils package, this tool isnt yet standard on all Linux distributions.
The following are recipes for writing your calendar files, including other calendar files in your own
calendar file, and for automating the delivery of your reminders.
NOTE: Emacs has its own equivalent to this tool, which it calls the Diary.
emacs-e20.info, node Diary for more information on this feature.
Christian holidays.
calendar.computer
calendar.history
calendar.holiday
calendar.judaic
Jewish holidays.
calendar.music
calendar.usholiday
U.S. holidays.
calendar.hindu
Hindu holidays.
To have calendar output dates from one of these files along with your usual appointments, put the
following in your calendar file, where file is the name of the particular calendar file you want to include:
#include <file >
For example, to output both US holidays and famous births and deaths when you run calendar,
put these lines somewhere in your calendar file:
#include <calendar.usholiday>
#include <calendar.birthday>
NOTE: You can, of course, share your own calendar files with other users; this is useful for making special calendars for a group or organization. If the calendar file is in the current directory or
/usr/share/calendar, you can just give the file name; otherwise, give its full path name in
the include statement.
To add the new entry in the file crontab to the cron schedule, type:
$ crontab crontab
RET
NOTE: The name of the command, crontab, is the same as the file, crontab.
This works nicely when the information you need is on the same line as the information you search
forhere, the name Scott is on the same line as the telephone number; however, the output did not show
the warning that appears on the next line in the file. And what about when the term you search for and
the information you need are on adjacent lines?
Use the -C option with grep to output several lines of context before and after matched lines.
To output the several lines around the line matching the text olfe, type:
$ grep -C olfe rolo
RET
$
Another way to search such a file is to open it as a buffer in Emacs and use any of the Emacs searches.
The Emacs incremental-search function, C-s, is very useful for such fileseven for very large
ones. If you do such a search on a large file, and the first result doesnt turn up the right record, just
keep typing C-s until the right one appears. If you type the letters to search for in all lowercase, Emacs
matches those letters regardless of case.
To search through the current buffer in Emacs for the first entry containing the text New York,
regardless of case, type:
C-s new york
To search for the next entry containing the text New York, regardless of case, type:
C-s
You can repeat the second example as many times as you wish to show all entries in the entire buffer
with the text New York in them. Once you reach the end of the buffer, type C-s again to loop around
to the beginning of the buffer and continue the search from there. (The minibuffer will tell you when
youve reached the end of the buffer, and will remind you to type this if you want to loop the search.)
NOTE: Its also useful to peruse and search through these kind of files with lesssee Section 14.7
[Searching Text in Less], page 155.
Use the bbdb function to search for recordsit takes as an argument the pattern or regexp to search
for.
To output records containing the text scott anywhere in the record, type:
M-x bbdb RET scott RET
There are additional functions that let you narrow your search to a particular field: bbdb-name,
bbdb-company , bbdb-net, and bbdb-notes, which respectively search the name, company,
email address, and notes fields.
To output records matching the regexp *\.edu in the email address, type:
M-x bbdb-net RET *\.edu RET
NOTE: For more about using the mail tool, see Section 30.1 [Sending Mail], page 275.
NOTE: leave will output a reminder on the terminal screen five minutes before the given time, one
minute before the time, at the time itself, and then every minute subsequently until the user logs off.
You can also give the time in minutes, hours, or days. To do this, follow the argument with a unit, as
listed in the following table.
D ESCRIPTION
U NIT
s
Seconds.
m
Minutes.
Hours.
Days.
To announce the time in exactly five minutes, type:
$ sleep 5m; saytime & RET
The shell command separator; see Section 3.1.4 [Running a List of Commands], page 36.
28 Mathematics
Tools and techniques for dealing with numbers are the subject of this chapter: listing them in sequence or
randomly, calculating arithmetic, and converting between units. Larger applications, such as spreadsheets
and plotting tools, are also mentioned.
$ calc 50*10
500
$
RET
To output the result of 100 times the sum of 4 plus 420, type:
$ calc 100*(4+420)
42400
$
RET
$ calc 10%3
1
$
RET
NOTE: This tool is useful for quickly computing a simple arithmetic equation, but it has several drawbacks: it only outputs whole integers, its operators are limited, and complex expressions must be quoted.
For doing anything more than the simplest operations, see the next recipe, which describes bc.
Debian: bc
WWW: ftp://src.doc.ic.ac.uk:/pub/gnu/bc-1.05a.tar.gz
When you have a lot of calculations to make, or when you must compute numbers with decimals, use
bc, a calculation language that supports arbitrary precision numbers. Type bc to perform arithmetic
operations interactively, just like you would with a calculator.
Type each statement to evaluate on a line by itself, typing RET at the end the statement; the evaluation
of what you type is output on the following line. Each line you type will be evaluated by bc as an
arithmetic expression. To exit, type quit on a line by itself.
To multiply 42 and 17, type:
$ bc RET
bc 1.05
Copyright 1991, 1992, 1993, 1994, 1997, 1998 Free Software
Foundation, Inc.
This is free software with ABSOLUTELY NO WARRANTY.
For details type warranty.
42 * 17 RET
714
quit RET
$
In this example, bc output its version number and warranty information when it started; then, the
statement 42 * 17 was typed by the user, bc output the result (714), and then the user typed quit to
exit bc.
By default, digits to the right of the decimal point are truncated from the outputso dividing 10 by
3 would output 3 as a result, and outputting the remainder from this operation by typing 10%3 would
output a 1. However, bc is an arbitrary precision calculator, and you can give the number of digits to
use after the decimal point by specifying the value of the scale variable; its default value is 0.
To use bc to compute the result of 10 divided by 3, using 20 digits after the decimal point, type:
$ bc RET
bc 1.05
Copyright 1991, 1992, 1993, 1994, 1997, 1998 Free Software
Foundation, Inc.
This is free software with ABSOLUTELY NO WARRANTY.
For details type warranty.
scale=20 RET
10 / 3 RET
3.33333333333333333333
quit RET
$
The following table describes the symbols you can use to specify mathematical operations.
S YMBOL
O PERATION
expression + expression
expression - expression
expression * expression
expression / expression
expression % expression
expression expression
Power: raise the first expression to the power of the second expression.
(expressions )
sqrt(expression )
To output the sequence from one number to another, give those numbers as arguments.
To output the sequence of numbers from two to six, type:
$ seq 2 6 RET
To specify an increment other than one, give it as the second argument, between the starting and
ending number.
To output the sequence of numbers from -1 to 14, incrementing by 3, type:
$ seq -1 3 14 RET
Use the -w option to pad numbers with leading zeros so that theyre all output with the same width.
Specify a separator string to be output between numbers as an argument to the -s option; the default
is a newline character, which outputs each number in the sequence on its own line.
To output the sequence of numbers from 9 to 999, incrementing by 23, with numbers padded with
zeros so that theyre all of equal width, type:
$ seq -w 9 23 999 RET
To output the sequence of numbers from 1 to 23, with a space character between each, type:
$ seq -s 1 23 RET
To pass a sequence of numbers as arguments to a command, pipe the output of seq using a space
character as a separator.
To concatenate all the files in the current directory, whose names are numbers from 25 through 75,
into a new file called selected-mail, type:
$ cat seq -s " " 25 75 > selected-mail RET
NOTE: If no number is given, factor reads numbers from standard input; numbers should be separated
by space, tab, or newline characters.
RET
In this example, the output indicates that there are about 1.7636981 ounces in 50 grams, and that
conversely, one ounce is about 0.56699046 times 50 grams.
The units tool understands a great many different kinds of unitsfrom Celsius and Fahrenheit to
pounds, hectares, the speed of light, and a bakers dozen. All understood units are kept in a text file
database; use the -V option to output the location of this database on your system, which you can then
peruse or search through to see the units your version supports.
To determine the location of the units database, type:
$ units -V RET
units version 1.55 with readline, units database in
/usr/share/misc/units.dat
$
RET
D ESCRIPTION
calc is a scientific calculator tool for Emacs.
Debian: calc
dc
dome
gnucash
GnuCash is an intuitive personal finance application. Use it for managing finances, including bank accounts, stocks, income, and expenses;
its based on professional accounting principles to ensure accuracy
in computation and reporting.
Debian: gnucash
WWW: http://www.gnucash.org/
gnumeric
gnuplot
The gnuplot tool can be used for data visualization, making 2-D and
3-D graphs, and plotting functions.
Debian: gnuplot
WWW: ftp://ftp.gnu.org/pub/gnu/gnuplot/
oleo
sc
xcalc
xspread
29 Communications
You will almost certainly want to go online, or otherwise communicate with other systems. Most
systems today are sold with the necessary hardware that you need in order to be able to connect to other
systems, such as a modem or a network card. You connect this hardware to the outside world via a
telephone line or network connection.
This chapter includes recipes for connecting your Linux system to the Internet with an ISP, using fax
services, and making serial connections with a modem.
For more information on this subject, see The Linux Network Administrators Guide
(http://metalab.unc.edu/mdw/LDP/nag/nag.html).
The following recipes show how to set up and use a PPP (Point-to-Point Protocol) dial-up connection, long the de facto means of connecting a computer to the Internet over a dial-up line.
In this example, after eight lines of modem initialization strings, the modem is instructed to dial the
ISP dial-up number, 5551010. Some systems need one or two commas after the number to signify
pauses for the modem; only do this if you cant get a good connection with just the telephone number in
this space.
Next is the host line: this is an optional line used by some ISPs whose connection line contains a
choice of services from which you must make a selection before entering your username and password
(some ISPs offer SLIP and shell access along with the standard PPP, for example); customize this and
the following lines as instructed by your ISP.
Finally, the username smith is given, and then the password of secret. The password appears
between two \q strings, whichfor security purposesinstruct ppp to display the question mark
(?) characters instead of the actual password in system log files or other places where an intruder might
see it.
Next, edit the file /etc/ppp/peers/provider so that it contains these lines:
connect "/usr/sbin/chat -v -f /etc/chatscripts/provider"
defaultroute /dev/modem 115200 persist
The last line in this file should include the device name of the modem you are using and the maximum
connect speed to try; the preceding example uses /dev/modem as the device name of the modem, and
115,200 bps as the maximum connect speed, which is a good value for a typical 56K modem (a rule
of thumb is to use the highest connect speed your modem supports; you can always go lower when a
connection is made, but you can never raise the speed above what is given here).
Finally, edit the file /etc/resolv.conf so that it contains the following, using the two nameserver IP addresses given to you by your ISP:
search .
nameserver
nameserver address 1
nameserver
nameserver address 2
For the two nameserver address values, use the IP address of the nameserver machines, as given to
you by your ISP. The second is optionalmost ISPs have more than one designated nameserver as a
backup in the event that the first system becomes unavailable.
Make sure that your user account has membership to the dialout group; otherwise, youll have to
have the superuser account start and stop PPP, which is not recommended (see Section A.3.2 [Letting
Users Access Hardware Peripherals], page 318).
Once youve done these things, you should be able to start and stop PPP connections to the Internet.
Complete documentation for setting up PPP is in the /usr/share/doc/ppp directory.
Once you have a PPP connection, you can connect to other systems on the Internet via the WWW or
other network services, as described in the following chapters.
To make PPP automatically start when the system first boots, rename the file
/etc/ppp/no_ppp_on_boot to /etc/ppp/ppp_on_boot.
(you must be root,
the superuser, to do this.)
To output the last few lines of the PPP log file, type plog. This is useful for checking the progress
of your PPP connection when it first dials.
Use the poff tool to stop a PPP session. It disconnects your computer from your ISP and hangs up
the modem.
29.2 Faxing
Debian: efax
WWW: http://casas.ee.ubc.ca/efax/
If you have a Class 1 or 2 fax modem, you can send and receive fax (facsimile) messages with your
Linux system. The following subsections show how to do this with the efax package, which is designed
for single user systems or relatively simple fax configurations (more complicated tools for faxing exist,
but they are beyond the scope of this book).
To set up efax for faxing, edit the file /etc/efax.rc (you must be root to do this). The
important things to specify in this file are the value for DEV, which is the device name in /dev
of the fax or modem device (this should almost always be modem), and the values for FROM and
NAMEthe fax number and organization name to appear on outgoing faxes.
NOTE: Unless you have membership to the dialout group, you must ask your system administrator for access to the modem hardware before you can use it (see Section A.3.2 [Letting Users Access
Hardware Peripherals], page 318).
More information on faxing is contained in the Fax Server mini-HOWTO (see Section 2.8.6 [Reading
System Documentation and Help Files], page 31).
To fax a copy of the file resume.txt to the number 555-9099, using DTMF tone dialing,
type:
$ efax -d /dev/modem -t T555-9099 resume.txt RET
To send more than one file, specify them as arguments in the order they are to be sent. You can
also specify them with a wildcard character, but be carefulthey are sent in the order in which the shell
expands the file names, which is alphabetical order. If you have a lot of files that should be sent in a
particular order, rename them so their file names begin with the number of the page they correspond to.
But be sure to number them with the same number of digits for each filefor example, if you have eleven
files to fax, dont name them 1.fax, 2.fax, and so on, to 10.fax and 11.fax, because the
shell will expand them in the order of 1.fax, 10.fax, 11.fax, 2.fax, 3.fax, and so on
up to 9.fax. In this case, you would number them as 01.fax, 02.fax, and so on, so that files
one through nine contain the same number of digits in their name as do 10.fax and 11.fax.
To fax all of the files with the .fax extension in the current directory to the number 555-9099,
using DTMF tone dialing, type:
$ efax -d /dev/modem -t T555-9099 *.fax RET
Another way to do this is to make a text file containing the list of files to fax, one file name per
line, in the order you want them sent. If the files you want to send are not in the current directory, be
sure to write the file names with path names relative to the current directoryso for example, if you
want to send the file header.fax, which is in your home directory, and the current directory is
/documents/faxes, the file should be specified as /header.fax.
To fax all of the files listed in the file fax.list to the number 555-9099, dialing 9 first to
obtain an outside line, and using DTMF tone dialing, type:
$ efax -d /dev/modem -t T9,555-9099 $(cat fax.list) RET
This command starts efax and sets up the modem to wait for an incoming fax. After a fax is received,
efax exits. You can stop efax before it receives a fax by typing C-c or by killing the efax job (see
Section 3.3.5 [Stopping a Job], page 39).
When a fax is received, it is written to a file in the current directory whose base name consists of
the current numeric date and a session number generated by efax; each page is written to a separate
file whose three-digit file extension is the page number. The received fax files are in TIFF Group 3
fax format; use display to view them (see Section 17.2 [Viewing an Image in X], page 184), or
convert them to PostScript or another format for printing (see Section 29.2.4 [Converting to and from
Fax Format], page 273).
$ faxon RET
efax: Wed Feb 24 08:38:52 1999 efax v 0.8a (Debian release 08a6)
Copyright 1996 Ed Casas
efax: 38:52 opened /dev/modem
efax: 38:53 waiting for activity
Each time a fax is received and then saved, efax restarts, waiting for another fax. A session log is
written to the file faxlog in your home directory.
Should an incoming facsimile message arrive, efax will receive it and write the message in files in
the current directory, with a file name convention as described previously; then efax restarts, ready to
receive another fax. Type C-c to stop the script and exit efax.
RET
This command converts a copy of the file chart.pbm to the tiffg3 fax format, writing it to a
file called chart.fax. The original PBM file is not altered.
To convert a PostScript file to fax format, use gs and specify tiffg3 as the output device to write
tosee Section 25.3.1 [Preparing a PostScript File for Printing], page 241.
RET
This command (typed all on one line) writes a copy of the file resume.ps to the file
resume.fax in tiffg3 format, which you can then send as a fax. The original PostScript file is
not altered.
To convert a received fax file to a PostScript file that you can then preview (see Section 17.1.2 [Previewing a PostScript File], page 183) or print (see Section 25.1.1 [Sending a Print Job to the Printer],
page 237), use the -o ps option.
RET
This command converts the fax file into a PostScript file called received.ps.
The bottom line contains a status bar showing a message describing how to get help, the current
modem settings (in this case, 57,600 bps, 8 data bits, no parity, one stop bit), whether or not cursor
keys work (the mysterious NOR message), the version of the program (1.82), the kind of terminal
emulation currently set (VT102), and whether or not an online connection is currently established.
To get a help menu, type C-a z; from this menu, you can press P to set the communications parameters, T to set the terminal settings, O to configure minicom, or D to enter the dialing directory.
To dial a number from the main screen, type ATDT followed by the number to dial.
To dial the number 368-2208, type:
ATDT3682208 RET
When you type RET, minicom will begin dialing the number; type any key to interrupt the dialing
and hang up the line. Once connected, type C-a h to hang up the line and type C-a x to hang up the
line and exit the program.
NOTE: minicom isnt really a way to connect your system to the Internet; to do that, you normally
start a PPP connection, as described earlier in this chapter.
Technically, you can use minicom to dial a computer that is connected to the Internet, like a local Free-Net system, but
your access to the net will be restricted to inside this minicom window; with a traditional Internet connection, such as
PPP, your whole system has direct access to the net, including your Web browsers, email software, and other networking
tools.
30 Email
The primary means of sending plain-text messages (or binaries in attachment files) between users across
computer networks and systems on the Internet is called electronic mail, or email (and more often than
not these days, just mail).
The number of email applications (called mail user agents, or MUAs) available for Linux is large,
and you could spend endless hours exploring the details of all of them. Instead of guiding you toward
this route, this chapter attempts to do three things: give a brief intro to using the default mail agent; give
an overview of other well-supported mail agents, with pointers on where to go for more info; and show
how you can use other tools on the system to manipulate your email.
The mail tool is the default mail agent on Debian and most other Linux systems. It comes without
many bells and whistles that are standard with most MUAs, and any user who sends and receives email
more than occasionally will certainly want to learn a more advanced system (see Section 30.6 [Picking
the Right Mail Application], page 283).
However, mail is available on almost all Unix-based systems, and it works in a pinchby learning
to use it you can always send and receive email on any Linux- or Unix-based system you encounter.
NOTE: On some Unix-based systems, the name of the tool is mailx instead of mail.
The text you type on the Subject: line is displayed as the subject of your email message, and
the lines of text you type after that is the body text of the message. Type C-d on a line alone to end the
message. Then, mail prompts for Cc: addresses; a carbon copy of the email message is sent to any
addresses you give here, if any (just type RET for none, and separate multiple addresses with commas).
When you type, mail just reads the standard input like any other command-line tool, so theres little
direct editing capability in this basic email serviceuse C-u to erase the current line, and C-c C-c
(that is, C-c pressed twice) to cancel your input and abort the message altogether.
Thats it! No bells, no whistlesbut no time-wasting excess, either.
RET
This command sends an email message to the user mrs on the local system. The email message itself
is empty, but the subject is a short note asking whether user mrs will be attending a party.
NOTE: Besides being good for sending mail to users that you might share your system with, mail is
useful for sending yourself mail, as a way to give yourself a reminder at your terminal (see Section 27.6.1
[Sending Yourself Email Reminders], page 259).
On a blank line, either of these commands sends the message and then
exits mail.
C-u
Erase the current line and move the cursor to the beginning of the line.
There are also a few special commands that you may use while composing the body of the message.
Theyre known as tilde escapes because you specify them by typing a tilde character ().
The following table lists some of these commands and describes their functions.
D ESCRIPTION
C OMMAND
!command
Run command in a shell.
baddress
Copy the file dead.letter from your home directory into the
message.
Edit the message in the default text editor program. (When you exit
the text editor, you are returned to mail.)
fnumber
Insert copies of the specified received messages into the message body.
Messages are specified by number or a range (for example, 2-4 inserts messages two through four inclusive); if no number is given, the
current received message is inserted.
rfile
wfile
Write a copy of the body text into the file file.
These commands should each be typed on a line by itself.
To insert a copy of the current mail message into the body of the message you are writing, and then
open the message in the default text editor, type:
f RET
e RET
Usually, the INBOX location is in the /var/spool/mail directory, and has the same name as
your usernameso if your username is mrs, your INBOX is likely /var/spool/mail/mrs.
You shouldnt directly edit this file, because doing so can inadvertently cause you to lose incoming
mail.
To see if you have any mail waiting in your INBOX, type mail. If you dont have any mail, mail
will indicate this and exit; if you do have mail waiting, mail outputs a list of message headers, one line
per message, each containing the status of the message (N for new messages, blank for previously read
messages), the message number, the name of the sender, the date and time the message was received, and
the number of lines and characters in the message.
To see if you have mail, type:
$ mail RET
Mail version 8.1 6/6/93. Type ? for help.
"/var/spool/mail/m": 3 messages 3 new
>N 1 mrs
Mon Sep 6 17:29 13/345 "Re: A modest proposal"
N 2 Ray
Tue Sep 7 04:20 15/694 "Latest news"
N 3 lisa@example Tue Sep 7 09:35 19/869 "Re: Hello"
&
In this example, the user has three messages waitingone from mrs, one from Ray, and one from
lisa@example.com.
The mail prompt is an ampersand (&) character; from there, you can read, delete, reply to, and
save messages.
When you type RET at the & prompt, mail outputs the next unread message to the screen. You can
also type a number to output that message.
To read the next unread message in mail, type:
& RET
To read message number three in mail, type:
& 3 RET
There are two ways to exit mail: type q to exit mail and apply the deletion commands you have
given, if any, to your INBOX; type x to exit mail and revert the state of your INBOX to how it was
before you ran mail.
To exit mail and revert your INBOX to its state before you started mail, type:
& x RET
Exit mail and apply the changes you have made in this mail session
to your INBOX.
Reply to the message you last read; you can also give a message number as an argument to reply to that message number.
Undelete a message you have deleted in the current mail session. Give
the number or range of the message(s) to be undeleted as an argument.
Exit mail and revert the INBOX to its state before this mail session.
s file
Save the message you last read to the file in your home directory specified by file (if the file does not exist, mail will ask you whether or
not it should create it).
NOTE: By default, only you (and, as always, the superuser) have access to read your INBOX. While
there are tools available (such as mail, and the other MUAs) to read this file in special ways, you can
also view this file like any other text file (see Chapter 9 [Viewing Text], page 99).
If you save your mail messages in a lot of separate folders, you can view a sorted list of all messages
from all files by using cat in conjunction with elm. Concatenate all the folders into one with cat and
then view that file in elm as you would view any folder.
To view the contents of all of the email folders in your /email directory, type:
$ cat /email/* > allmessages RET
$ elm -f allmessages RET
These commands write a new file, allmessages, in the current directory, containing the contents
of all email folders in /email; then, that file is viewed in elm.
NOTE: To view a list showing who all the messages in a folder are from, use frm; see Section 30.3.4
[Seeing Who Your Mail Is From], page 281.
Some people put the above line in their .bashrc file so that biff is always set on in all of their
shells (see Section 3.6.1 [Changing the Shell Prompt], page 42).
Typing biff alone with no options will tell you whether biff is set to y or n.
To see what biff is set to, type:
$ biff RET
A companion tool, xbiff, works only in the X Window System (you can use the regular biff in
X, too). When you start it, xbiff draws a window containing a mailbox that looks like this:
When you have mail, xbiff rings the system bell, the window icon reverses color, and the mailbox
flag goes up:
NOTE: The original version of biff was named after a dog. In the early 1980s at a UC Berkeley
computer lab, a girl would bring her dog, Biff, with her when she went to use the computers. Biff was
known for barking at the mailman when he came in to deliver the days mail. He was also very popular
with all of the BSD UNIX hackers at Berkeley, and when one of them wrote a mail notification tool, he
thought of Biffhence the name. (Biff, the dog, died in August 1993.)
Noah
use,
available
from
NOTE: An alternate tool, from, works in similar fashion, but it does not output subject lines; instead, it
outputs the names of senders and the time that messages were received.
Use the -f option to specify a text file containing email addresses; vrfy attempts to verify all
email addresses contained in the file.
To verify all of the email addresses contained in the file net-legends-faq, type:
$ vrfy -f net-legends-faq RET
NOTE: vrfy relies on the remote system to get this information; in these days of the heavily corporatized Internet, an increasing number of sites no longer supply this kind of information to the general
public. However, its still useful enough to be worth mentioning.
In this example, the mail tool was used to open the INBOX and write the message to a file called
image.mail; then, metamail was run with the file name as an argument.
$ metasend RET
To: dali@example.org RET
Subject: The image you requested RET
CC: RET
Content-type: image/jpeg RET
Name of file containing image/gif data: dream.jpeg RET
Do you want to encode this data for sending through the mail?
1 -- No, it is already in 7 bit ASCII
2 -- Yes, encode in base64 (most efficient)
3 -- Yes, encode in quoted-printable (less efficient, more readable)
4 -- Yes, encode it using uuencode (not standard, being phased out)
2 RET
Do you want to include another file too (y/n) [n] ? n RET
Delivering mail, please wait... Mail delivery apparently succeeded.
$
The following table lists values to use in the MIME Content-type: field for various kinds of
files.
VALUE
F ILE T YPE
application/gzip
File compressed with gzip.
application/zip
image/png
audio/basic
Audio file.
audio/mpeg3
audio/wav
If you want to use more than one signature, use sigrot to rotate your various signaturesevery
time you run sigrot, it selects one of the signature files you keep in your .sigrot directory and
writes it to .signature. To change your .signature every time you log in, you would run
sigrot in your .bash_login file (see Chapter 3 [The Shell], page 33).
D ESCRIPTION
A graphical email client that works in X with GNOME installed; its
interface is inspired somewhat by the proprietary Eudora.
Debian: balsa
WWW: http://www.balsa.net/
elm
A menu-driven MUA, elm was popular in the early 1990s among experienced usersit has some interesting features, including ways to
send mails in batch mode to many addresses at once, and a tool to send
telephone messages as email messages. Interest in elm has waned
somewhat over the years, and most novices are advised to try mutt
instead.
Debian: elm me+
WWW: http://www.instinct.org/elm/
gnus
The gnus newsreader for Emacs can also be used to read and send
mail. It has many features and should appeal to Emacs loversbut a
warning: it can be daunting to learn!
Debian: gnus
WWW: http://www.gnus.org/
mew
mh-e
MH-E is an Emacs front end to nmh, below. Its very powerful, yet it
remains easy to use.
Debian: emacsen-common
WWW: http://www.emacs.org/
mozilla
Netscape Inc.s open source Web browser, mozilla, has its familiar and self-explanatory email interface that works in the X Window
System.
Debian: mozilla
WWW: http://www.mozilla.org/
mutt
nmh
The Rand Mail Handling system, mh, is not one application but a
collection of small tools for manipulating mail folders. It should appeal to those who excel at building complex commands from combinations of simple tools and operators. nmh is the new Mail Handling
system, containing rewrites and improved versions of the mh tools.
Most Linux systems will install this over the old mh.
Debian: nmh
WWW: http://www.mhost.com/nmh/
vm
wl
Next to email, the most useful service on the Internet is the World Wide Web (often written WWW or
Web). It is a giant network of hypertext documents and services, and it keeps growing by the instant
anyone with an Internet-connected computer can read anything on the Web, and anyone can publish to
the Web. It could well be the worlds largest public repository of information.
This chapter describes tools for accessing and using the Web. It also describes tools for writing text
files in HTML (HyperText Markup Language), the native document format of the Web.
When most people think of browsing or surfing the Web, they think of doing it graphicallyand the
mental image they conjure is usually that of the famous Netscape Web browser. Most Web sites today make heavy use of graphic images; furthermore, commercial Web sites are usually optimized for
Netscape-compatible browsersmany of them not even accessible with other alternative browsers. That
means youll want to use this application for browsing this kind of Web site.
The version of Netscapes browser which had been released as free, open source software (see Section 1.1.3 [Whats Open Source?], page 10) in 1998 to much fanfare is called Mozilla. When first
released, the Mozilla application was a developers only release, but as of this writing it is finally
reaching a state where it is ready for general use.
Once the Mozilla browser has been installed, run it in X either by typing mozilla in a shell or by
selecting it from a menu in the usual fashion, as dictated by your window manager.
Like most graphical Web browsers, its use is fairly self-explanatory; type a URL in the Location
dialog box to open that URL, and left-click on a link to follow it, replacing the contents of the browsers
main window with the contents of that link. One nice feature for Emacs fans is that you can use Emacsstyle keystrokes for cursor movement in Mozillas dialog boxes (see Section 10.2.2 [Basic Emacs Editing
Keys], page 111).
Netscapes browsers, from their earliest Navigator release to their later Communicator series, were always referred to by
the company as Mozilla; this was a pun on the name Mosaic, which had been the first popular graphical Web browser in the
early 1990sNetscapes goal had been to make a monster Mosaic.
The browser history logs are kept in a hidden directory called .browser-history in your home
directory. The current history log is always called history-log.html; its an HTML file that you
can view in a Web browser.
To view the current history log with lynx, type:
$ lynx /.browser-history/history-log.html RET
Past history logs have the year, month, and week appended to their name, and they are compressed
(see Section 8.5 [Compressed Files], page 92). After uncompressing them, you can view them just as
you would view the current log (if you are viewing them in Mozilla, you dont even need to uncompress
themit handles this automagically.)
You can also use zgrep to search through your old browser history logs. The logs keep the URL and
title of each site you visit, so you can search for eitherthen when someone asks, Remember that good
article about such-and-such? you can do a zgrep on the files in your /.browser-history
directory to find it.
To find any URLs from the list of those you visited in the year 2000 whose titles contain the word
Confessions, type:
$ zgrep Confessions /.browser-history/history-log-2000* RET
This command searches all your logs from the year 2000 for the text Confessions in it, and
outputs those lines.
NOTE: For more about zgrep, see Section 14.3.1 [Matching Lines in Compressed Files], page 152.
NOTE: When viewing the image, you can use all of the image manipulation commands that display
supports, including resizing and changing the magnification of the image. For more information about
display, see Section 17.2 [Viewing an Image in X], page 184.
or
RET
DEL
PgDn
PgUp
or
SPC
Like many of my generation, it was through lynx that I had my first view of the Web.
Go to a URL; lynx will prompt you for the URL to go to. Type to
insert on this line the last URL that was visited; once inserted, you can
edit it.
NOTE: Emacs users might want to use the -emacskeys option when starting lynx; it enables you
to use Emacs-style keystrokes for cursor movement (see Section 10.2.2 [Basic Emacs Editing Keys],
page 111).
NOTE: To peruse the plain text of a URL with its HTML tags removed and no formatting done to the
text, see Section 31.6.2 [Converting HTML to Another Format], page 295.
Its often common to combine this with the options for saving to a file, so that you can retrieve an
annotated text copy of a file from a site that normally requires registration.
To save the URL http://www.nytimes.com/archive/ as an annotated text file,
mynews, type (all on one line):
$ lynx -dump -number_links -auth=cypherpunks:cypherpunks
http://www.nytimes.com/archive/ > mynews RET
NOTE: The username and password argument you give on the command line will be recorded in your
shell history log (see Section 3.4 [Command History], page 40), and it will be visible to other users on
the system should they look to see what processes youre running (see Section 2.7.2 [Listing All of a
Users Processes], page 25).
-cache=integer
-case
-dump
Dump the text contents of the URL to the standard output, and then
exit.
-emacskeys
-force_html
Forces rendering of HTML when the URL does not have a .html
file name extension.
-help
Output a help message showing all available options, and then exit.
-localhost
-nolist
-number_links
-partial
-pauth=user :pass
-underscore
-use_mouse
-version
-vikeys
-width=integer
Bill Perrys Emacs/W3, as its name implies, is a Web browser for Emacs (giving you, as Bill says, one
less reason to leave the editor). Its features are manyjust about the only things it lacks that you may
miss are SSL support (although this is coming) and JavaScript and Java support (well, you may not miss
it, but it will make those sites that require their use a bit hard to use). It can handle frames, tables,
stylesheets, and many other HTML features.
To start W3 in Emacs, type:
M-x w3 RET
To open a URL in a new buffer, type C-o and, in the minibuffer, give the URL to open (leaving
this blank visits the Emacs/W3 home page). Middle-click a link to follow it, opening the URL in a new
buffer.
To open the URL http://gnuscape.org/, type:
C-o http://gnuscape.org/ RET
To open the URL of the Emacs/W3 home page, type:
C-o RET
The preceding example opens the Emacs/W3 home page in a buffer of its own:
BKSP
M-TAB
M-s
Save a document to the local disk (you can choose HTML Source,
Formatted Text, LaTeX Source, or Binary).
C-o
Open a URL.
Put the URL of the document in the current buffer in the kill ring, and
make it the X selection (useful for copying and pasting the URL into
another buffer or to another application; see Section 10.4 [Selecting
Text], page 115).
Put the URL of the link at point in the kill ring and make it the X
selection (useful for copying and pasting the URL into another buffer
or to another application; see Section 10.4 [Selecting Text], page 115).
Quit W3 mode, kill the current buffer, and go to the last visited buffer.
View HTML source of the link at point in the current buffer (opens in
new buffer with the URL as its name).
Show the URL of the current document (URL is shown in the minibuffer).
Show URL of the link under point in the current buffer (URL is shown
in the minibuffer).
NOTE: If you get serious about using Emacs/W3, youll almost certainly want to run the XEmacs flavor
of Emacsas of this writing, GNU Emacs cannot display images.
This command reads a given URL, writing its contents to a file with the same name as the original,
septembr.mp3, in the current working directory.
If you interrupt a download before its finished, the contents of the file you were retrieving will contain
only the portion of the file wget retrieved until it was interrupted. Use wget with the -c option to
resume the download from the point it left off.
To resume download of the URL from the previous example, type:
$ wget -c ftp://ftp.neuron.net/pub/spiral/septembr.mp3 RET
NOTE: In order for the -c option to have the desired effect, you should run wget from the same
directory as it was run previously, where that partially-retrieved file should still exist.
This command makes an archive of the Web site at www.bloofga.org in a subdirectory called
www.bloofga.org in the current directory. Log messages are written to a file in the current directory called mirror.log.
To continue an archive that youve left off, use the -nc (no clobber) option; it doesnt retrieve
files that have already been downloaded. For this option to work the way you want it to, be sure that you
are in the same directory that you were in when you originally began archiving the site.
To continue an interrupted mirror of the Web site at http://www.bloofga.org/ and make
sure that existing files are not downloaded, giving up to three retries for retrieval of files and putting
error messages in a log file called mirror.log, type:
$ wget -nc -m -t3 http://www.bloofga.org/ -o mirror.log RET
This command archives all files on the http://dougal.bris.ac.uk/mbt/ Web site whose
directory names begin with /mbt.
To only get files in a given directory, use the -r and -l1 options (the -l option specifies the
number of levels to descend from the given level). To only download files in a given directory, combine
these options with the --no-parent option, which specifies not to ascend to the parent directory.
Use the -A option to specify the exact file name extensions to acceptfor example, use -A
txt,text,tex to only download files whose names end with .txt, .text, and .tex extensions. The -R option works similarly, but specifies the file extensions to reject and not download.
To download only the files ending in a .gz extension and only in the given directory
/rjh/indiepop-l/download/ at monash.edu.au, type:
$ wget -m -r -l1 --no-parent -A.gz
http://monash.edu.au/rjh/indiepop-l/download/ RET
This command writes the server response headers to standard output and saves the contents of
http://slashdot.org/ to a file in the current directory whose name is the same as the original
file.
NOTE: When youre editing an HTML file in an Emacs buffer, you can open the same file in a Web
browser in another windowWeb browsers only read and dont write the HTML files they open, so you
can view the rendered document in the browser as you create it in Emacs. When you make and save a
change in the Emacs buffer, reload the file in the browser to see your changes take effect immediately.
When you remove the HTML tags from a file with unhtml, no further formatting is done to the text.
Furthermore, it only works on files, and not on URLs themselves.
Use lynx to save an HTML file or a URL as a formatted text file, so that the resultant text looks like
the original HTML when viewed in lynx. It can also preserve italics and hyperlink information in the
original HTML. See Section 31.3.1 [Perusing Text from the Web], page 289.
One thing you can do with this lynx output is pipe it to tools for spacing text, and then send that to
enscript for setting in a font. This is useful for printing a Web page in typescript manuscript form,
with images and graphics removed and text set double-spaced in a Courier font.
To print a copy of the URL http://example.com/essay/ in typescript manuscript form,
type:
$ lynx -dump -underscore -nolist http://example.com/essay/ | pr d
| enscript -B RET
NOTE: In some cases, you might want to edit the file before you print it, such as when a Web page
contains text navigation bars or other text that youd want to remove before you turn it into a manuscript.
In such a case, youd pipe the lynx output to a file, edit the file, and then use pr on the file and pipe
that output to enscript for printing.
Finally, you can use html2ps to convert an HTML file to PostScript; this is useful when you want
to print a Web page with all its graphics and images, or when you want to convert all or part of a Web
site into PDF. Give the URLs or file names of the HTML files to convert as options. Use the -u option
to underline the anchor text of hypertext links, and specify a file name to write to as an argument to the
-o option. The defaults are to not underline links, and to write to the standard output.
To print a PostScript copy of the document at the URL http://example.com/essay/ to the
default printer, type:
$ html2ps http://example.com/essay/ | lpr RET
To write a copy of the document at the URL http://example.com/essay/ to a PostScript
file submission.ps with all hypertext links underlined, type:
$ html2ps -u -o submission.ps http://example.com/essay/ RET
Developed by the World Wide Web Consortium; a very compact, HTML 3.0compliant Web browser for X.
Debian: arena
WWW: http://www.w3.org/arena/
dillo
express
links
gzilla
w3m
Another new text-only browser whose features include table support and an interesting free-form cursor control; some people swear by this one.
Debian: w3m
WWW: http://ei5nazha.yz.yamagata-u.ac.jp/
/\
_! !_
_!__ __!_
__
!
!
_! !_
!
! !
!
!
!
/\
!
! !
!
!
! ! !
!
! !
!___
!
! !
!
!
! !
!
!
!
!_!_ !
!
! !
!
!
!
!
! !
!
! !
!
!
_!
!
!_!_ !
!
!_
!
!
!_!
!
!
!
!
!
CLEVELAND FREE-NET
!
!
COMMUNITY COMPUTER SYSTEM
!
!____________________________________!
WELCOME TO THE...
brought to you by
Case Western Reserve University
Office of Information Services
Are you:
1. A registered user
2. A visitor
Please enter 1 or 2: 1
RET
$ C-d
Connection closed.
In the preceding example, the first shell prompt was on the remote system, and the second prompt
was on the local system.
faraway-system$ C-[
telnet> z RET
[2]+ Stopped
$
telnet
$ fg RET
faraway-system$
In the first of the two preceding examples, the escape character C-[ was typed on the remote system,
whose shell prompt in this example is faraway-system$ (you dont have to type the escape character at a shell prompt, though; you can type it regardless of what program you are running or where you
are on the remote system). Then, the z command was given to telnet to suspend the telnet connection. In the second example, the suspended telnet connection to the remote system was brought
back into the foreground.
NOTE: You should be aware that its possible (though not often desirable) to nest multiple layers of
telnet sessions on top of each other by connecting from one system to the next, to the next, and so
on, without disconnecting from the previous system. To avoid this, make sure you know which host
youre leaving when youre about to telnet off to another; the hostname tool is useful for this (see
Section 2.2.1 [Logging In to the System], page 18).
In this example, the /pub directory contained three subdirectories (comp, rec, and
science) and two files, INDEX.gz and ls-lR.gz; many public systems have files similar
to these in their /pub directoriesINDEX.gz is a listing of all files on their ftp site, with
descriptions, and ls-lR.gz is the output of the command ls -lR run on the directory tree of their
ftp server.
The following subsections describe how to upload and download files. Use the quit command to
exit ftp and end the connection to the remote system.
The current directory of the local system is, by default, the directory where you ran the ftp command. To change directories on your local system, use lcd; it works just like the cd command, but it
changes the local directory.
To change to the parent directory of the current directory on the local system, type:
NOTE: The mget command works like get but allows wildcards; as with mput, you will be prompted
to verify each file unless you use the prompt command first to turn this off.
Humanities. news:humanities.music.composers.wagner
misc
Miscellaneous. news:misc.consumers.frugal-living
news
rec
Recreation. news:rec.music.marketplace.vinyl,
news:rec.food.cooking
sci
soc
talk
While there are many other hierarchies, these eight are technically the only newsgroups considered to
be part of Usenet proper. While netnews is the term for the collection of all newsgroups including those
in Usenet, these terms are often used interchangeably.
The alternative hierarchy, alt, is perhaps the most popular hierarchy of alljust about every
subject you might want to discuss has an appropriate newsgroup here, including non sequiturs. There
are also hierarchies for topics concerning certain geographical areas; for example, the cols. hierarchy is for topics pertaining to Columbus, Ohio, and seattle is for Seattle, Washington. So, while
cols.forsale pertains to items for sale in the greater Columbus area, seattle.forsale is
for items for sale in and around Seattle. Hierarchies can exist also for certain organizations; for example, the gnu hierarchy is for newsgroups concerning the GNU Project, and bit is for newsgroup
redistributions of the popular Bitnet LISTSERV mailing lists.
The following recipes describe tools for reading and posting articles to netnews.
D ESCRIPTION
Gnus is a very powerful and feature-full newsreader for use in Emacs. You can
use it to read mail, too.
Debian: gnus
WWW: http://www.gnus.org/
knews
A graphical newsreader for use in X. Its features include the display of article
threads in a graphical tree, and options for those reading news over slow connections.
Debian: knews
WWW: http://www.matematik.su.se/kjj/
mozilla
Historically, commercial Web browsers also had mail and newsreaders built into
them, and that capability remains in the Mozilla browser.
Debian: mozilla
WWW: http://www.mozilla.org/
nn
The motto of nn is No News is good news, but nn is better; its an older (and
very popular) newsreader that was designed for reading the most news in the
minimal amount of time.
Debian: nn
WWW: http://www.math.fu-berlin.de/guckes/nn/
pan
peruser
News Peruser is a suite of small tools for use in X that facilitate the reading and
composing of news articles when youre offlineit downloads batches of news
when your system is online.
Debian: peruser
WWW: http://www.ibiblio.org/pub/Linux/system/news/readers/
slrn
Based on rn, one of the oldest newsreaders, slrn is optimized for use over slow
connections (like home modem dial-ups).
Debian: slrn
WWW: http://www.slrn.org/
To output a list of all newsgroups that match the pattern society, type:
$ nngrep society
RET
Use the -u option to only search through unsubscribed groups. This is useful if you are subscribed
to a number of groups, and you are looking only for groups you arent subscribed to yet.
To output a list of all unsubscribed-to newsgroups that match the pattern society, type:
$ nngrep society
RET
In the previous example, if you were already subscribed to the group alt.society.neutopia,
that group will not be displayed; but other groups matching the pattern society that you are not
subscribed to would be listed.
In this example, the host bfi.org was pinged and a total of three pings were sent and received
before the user typed C-c to interrupt it. As long as these ping lines are output, you know that the other
machine is connected to the Internet (or at least to the same network that your localhost is connected to).
You really dont need to analyze the information on each line of a ping messagethe only useful
information is the number at the end of the line, which tells you how many milliseconds it took to go
out to the Internet, touch or ping that host, and come back. The quicker the betterpings that
are four or five digits long (or greater) mean a slow connection between the two machines. When you
interrupt the ping, some statistics are output, including the minimum, average, and maximum number
of milliseconds it took to ping the given host. In the example above, the high was 190 and the low was
159.9 milliseconds, with an average of 170.1.
NOTE: If your own system is not online, ping will report that either the network is unreachable or that
the host isnt found.
In this example, the user bradley on the system at ap.spl.org is not currently logged in, logged
in last on 20 January, and uses the tsch shell.
I named it after the sound that a sonar makes, inspired by the whole principle of echo-location, said the original author of
NOTE: On Unix-based systems, you can put information in a hidden file in your home directory called
.plan, and that text will be output when someone fingers you. Some people put elaborate information in their .plan files; in the early 1990s, it was very much in vogue to have long, rambling .plans.
Sometimes, people put information in their .plan file for special eventsfor example, someone who
is having a party next weekend might put directions to their house in their .plan file.
Tty Idle
*q2 16:23
*r4 1:01
*q9 15:07
*r1
14
t2
2
Login
Sep 27
Sep 28
Sep 27
Sep 28
Sep 28
Time
17:22
08:29
16:02
08:42
09:35
Office
(gate1.grayline)
(gopherd)
(johnnyzine)
(dialup-WY.uu.net)
(spl.org)
1D IN A
64.240.156.195
In this example, dig output the IP address of 64.240.156.195 as the IP address for the host
linart.net.
To find the host name that corresponds to the IP address 216.92.9.215, type:
$ dig -x 216.92.9.215 RET
...output messages...
;; ANSWER SECTION:
215.9.92.216.in-addr.arpa.
...output messages...
$
2H IN PTR
rumored.com.
In this example, dig output that the host name corresponding to the given IP address was
rumored.com.
NOTE: This command also outputs the names of the nameservers that handle the given domainthis is
useful to get an idea of where a particular Web site is hosted.
$ write sleepy
Wake up!
C-d
$
RET
The other user can reply to you by running write and giving your username as an argument. Traditionally, users ended a write message with -o, which indicated that what they were saying was
over and that it was now the other persons turn to talk. When a user believed that a conversation was
completed, the user would end a line with oo, meaning that they were over and out.
A similar command, wall, writes a text message to all other users on the local system. It takes a text
file as an argument and outputs the contents of that file; with no argument, it outputs what you type until
you type C-d on a line by itself. It precedes the message with the text Broadcast message from
username (where username is your username) followed by the current system time, and it rings the bell
on all terminals it broadcasts to.
To output the contents of /etc/motd to all logged-in terminals, type:
$ wall /etc/motd RET
To output the text Who wants to go out for Chinese food? to all logged-in terminals,
type:
$ wall RET
Who wants to go out for Chinese food? RET
C-d
You can control write access to your terminal with mesg. It works like biff (see Section 30.3.2
[Setting Notification for New Mail], page 279): with no arguments, it outputs whether or not it is set;
with y as an argument, it allows messages to be sent to your terminal; and with n as an argument, is
disallows them.
The default for all users is to allow messages to be written to their terminals; antisocial people usually
put the line mesg n in their .bashrc file (see Section 3.6.4 [Customizing Future Shells], page 43).
To disallow messages to be written to your terminal, type:
$ mesg n RET
To output the current access state of your terminal, type:
$ mesg
is n
$
RET
In the preceding example above, mesg indicated that messages are currently disallowed to be written
to your terminal.
This command sends a connection request to the user kat@kent.edu. If the user is not logged on
or is refusing messages, talk will output a message indicating such; but if that user is available, talk
will send a message to that user asking to complete the connection, and it will tell you that it is ringing
your party.
If that user then types talk stutz@dsl.org (if, in this example, your email address is
stutz@dsl.org), then your screen will clear and you will see the following:
You can then type, and what you type will appear on both your screen and that users screen; that
user, in turn, can also typeeven while you are typingand what that user types appears on the other
half of both screens:
It is standard practice to indicate that you are done saying something by typing RET RET, thus
making a blank line on your half of the screen. Some users, when they have typed to the bottom of their
half of the screen, sometimes type RET repeatedly to clear their half of the screen and bring the cursor
back to the top.
Type C-c to end a talk session.
When you type, both users see the characters appear in realtime; my first demonstration of the interactive nature of the Internet, back in 1991, was when I had a live, real-time chat with a user in Australia,
on the other side of the globethe magic felt that day has never quite left whenever I run this command!
NOTE: A similar command, ytalk, allows you to connect to multiple users, and it contains other
features as well; it is generally considered to be the superior successor of talk, but it is not yet available
or standard on all Unix-based systems.
C LIENT
bitchx
D ESCRIPTION
BitchX is an IRC client whose features include ANSI color, so it can
display all of the character escape codes that are popularly used on
IRC for special effects. Despite what you might gather from its name,
it doesnt require X in order to run.
Debian: bitchx
WWW: http://www.bitchx.org/
epic
irssi
A modular IRC client; note that some versions can only be run in X
with GNOME.
Debian: irssi
WWW: http://irssi.org/
xchat
zenirc
C LIENT
licq
D ESCRIPTION
Licq is an ICQ client for use in X.
Debian: licq
WWW: http://www.licq.org/
micq
zicq
If you already have the .deb file, use dpkg to install it. Use the -i option and give the name of
the file as an option. Any conflicts or dependencies will have to be resolved by you before the package
is installed. If a problem is detected, dpkg will report it and exit without installing the package.
To install the package in the miscfiles-1.1.7.deb file, type:
# dpkg -i miscfiles-1.1.7.deb RET
Finally, to peruse available packages and choose them from a menu, use dselect, the Debian
package selection tool. A word of caution: its menu interface is different from most programs you have
probably encountered, and its usage is unfortunately an acquired skill. Even the man page makes note of
this: The dselect package selection interface is confusing or even alarming to the new user.
NOTE: If youre new to Debian, I recommend consulting Dselect Documentation for Beginners
(http://www.debian.org/releases/2.1/i386/dselect-beginner.en.html).
so forth. A Linux system, therefore, needs to be kept up to date in order to reap the benefits of the latest
free software.
To upgrade a single package, use apt-get with the install argument, and follow that with the
name of the package to upgrade.
To upgrade the sview package, type:
# apt-get install sview RET
This command will upgrade the sview package to the most current version available, if greater
than the version already installed on your system. If additional packages must be upgraded first in order
for this new package upgrade to function properly, this command will fetch and upgrade those packages,
too. Before downloading any packages, apt-get will show the list of packages that will be installed,
replaced, or otherwise changed, and wait for confirmation first.
To bring your entire Debian system up to date, use the apt-get tool with the following command
arguments. First, use the update argument to update your systems list of available software packages.
Then run apt-get again, using either the upgrade argument to upgrade all of the installed packages
to their most recently available versions, or use the dist-upgrade argument when a new version of
the Debian system is announced, to upgrade to that new version.
To upgrade all of the software on your system to their most recent versions, type:
RET
This line means that the script is written in the perl language; the text after the #! is the full path
name of the perl program, which in this case is /usr/local/bin/perl.
If you try to execute this script and the system reports an error finding the file, youll have to change
that first line to correspond to the location of the perl binary on your system. The which tool will
output this location.
RET
RET
NOTE: By default, the name of the users home directory will be the same as the username. So, for
example, the user bucky will have a home directory of /home/bucky.
RET
$ uptime RET
3:34pm up 4:31,
$
4 users,
To get a list of the times and dates when the system was recently rebooted, give reboot as an
argument to last (see Section 2.6.4 [Listing the Last Times a User Logged In], page 24).
To output a list of times when the system was rebooted, type:
$ last reboot RET
NOTE: An operating system capable of running constantly for a long time without crashes or freeze-ups
is a good one, and so having a high uptime value is a matter of pride for many Linux users. It is not
uncommon to hear of systems that have been running for months and sometimes even years non-stop
one Linux administrator reported on the Internet about one of his work systems, which had been running
continuously without reboot for three years!
NOTE: Debian releases have historically been named after characters from the motion picture Toy Story.
http://linux.com/
Contains the latest Linux news, linux.com also has feature stories, links, and a database of Linux User Groups.
http://linuxgazette.com/
The Linux Gazette is a monthly webzine devoted to making Linux just a little more fun, and it has been published
by SSC for years. Its More 2-Cent Tips column is famous.
http://linuxdoc.org/
http://lwn.net/
http://mainmatter.com/
http://sal.kachinatech.com/
SAL (Scientific Applications on Linux) is the authoritative listing of scientific software that runs on Linux-based
systems.
http://slashdot.org/
http://sourceforge.net/
Sourceforge is the Internets largest community for developers of free software; it gives free resources to developers of
free software.
http://themes.org/
http://www.bright.net/
dlphilp/linuxsound/
http://www.thedukeofurl.org/ Provides non-partisan hardware reviews; if you are considering a new system, reading the Dukes latest Linux
Buyers Guide is an absolute must.
Additionally, the following table lists the primary Web sites for some of the most popular Linux
distributions.
W EB S ITE
L INUX D ISTRIBUTION
http://debian.org/
Debian GNU/Linux.
http://linux-mandrake.com/
Linux Mandrake.
http://redhat.com/
http://slackware.com/
Slackware Linux.
http://suse.de/
SuSE Linux.
Appendix C License
Like much of the software that makes a working Linux system, including the Linux kernel itself, the text
of this book is copylefted. That is, the copyright holder of the work has released it with a special kind
of copyright license that has come to be known as a copyleft license. That does not mean that it is in
the public domain, but rather, the copyleft describes a special set of terms that permit anyone to copy,
distribute, and modify the work, under those certain terms and conditions. For this book those terms are
described by the Design Science License, which follows.
The Work is copyright the Author. All rights to the Work are reserved by the Author, except as specifically described below. This License describes the terms and conditions under which the Author permits
you to copy, distribute and modify copies of the Work.
In addition, you may refer to the Work, talk about it, and (as dictated by fair use) quote from it, just as
you would any copyrighted material under copyright law.
Your right to operate, perform, read or otherwise interpret and/or execute the Work is unrestricted; however, you do so at your own risk, because the Work comes WITHOUT ANY WARRANTYsee Section
7 (NO WARRANTY) below.
3. COPYING AND DISTRIBUTION.
Permission is granted to distribute, publish or otherwise present verbatim copies of the entire Source
Data of the Work, in any medium, provided that full copyright notice and disclaimer of warranty, where
applicable, is conspicuously published on all copies, and a copy of this License is distributed along with
the Work.
Permission is granted to distribute, publish or otherwise present copies of the Object Form of the Work,
in any medium, under the terms for distribution of Source Data above and also provided that one of the
following additional conditions are met:
(a) The Source Data is included in the same distribution, distributed under the terms of this License; or
(b) A written offer is included with the distribution, valid for at least three years or for as long as the
distribution is in print (whichever is longer), with a publicly-accessible address (such as a URL on the
Internet) where, for a charge not greater than transportation and media costs, anyone may receive a copy
of the Source Data of the Work distributed according to the section above; or
(c) A third partys written offer for obtaining the Source Data at no cost, as described in paragraph (b)
above, is included with the distribution. This option is valid only if you are a non-commercial party, and
only if you received the Object Form of the Work along with such an offer.
You may copy and distribute the Work either gratis or for a fee, and if desired, you may offer warranty
protection for the Work.
The aggregation of the Work with other works that are not based on the Worksuch as but not limited
to inclusion in a publication, broadcast, compilation, or other mediadoes not bring the other works in
the scope of the License; nor does such aggregation void the terms of the License for the Work.
4. MODIFICATION.
Permission is granted to modify or sample from a copy of the Work, producing a derivative work, and
to distribute the derivative work under the terms described in the section for distribution above, provided
that the following terms are met:
(a) The new, derivative work is published under the terms of this License.
(b) The derivative work is given a new name, so that its name or title cannot be confused with the Work,
or with a version of the Work, in any way.
(c) Appropriate authorship credit is given: for the differences between the Work and the new derivative work, authorship is attributed to you, while the material sampled or used from the Work remains
attributed to the original Author; appropriate notice must be included with the new work indicating the
nature and the dates of any modifications of the Work made by you.
5. NO RESTRICTIONS.
You may not impose any further restrictions on the Work or any of its derivative works beyond those
restrictions described in this License.
6. ACCEPTANCE.
Copying, distributing or modifying the Work (including but not limited to sampling from the Work in a
new work) indicates acceptance of these terms. If you do not follow the terms of this License, any rights
granted to you by the License are null and void. The copying, distribution or modification of the Work
outside of the terms described in this License is expressly prohibited by law.
If for any reason, conditions are imposed on you that forbid you to fulfill the conditions of this License,
you may not copy, distribute or modify the Work at all.
If any part of this License is found to be in conflict with the law, that part shall be interpreted in its
broadest meaning consistent with the law, and no other parts of the License shall be affected.
7. NO WARRANTY.
THE WORK IS PROVIDED AS IS, AND COMES WITH ABSOLUTELY NO WARRANTY, EXPRESS OR IMPLIED, TO THE EXTENT PERMITTED BY APPLICABLE LAW, INCLUDING BUT
NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A
PARTICULAR PURPOSE.
8. DISCLAIMER OF LIABILITY.
IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
WORK, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
END OF TERMS AND CONDITIONS
Use the following text for the works copyright notice, substituting Year and Author for their appropriate values:
Copyright c Year Your Name ; this information may be copied,
distributed or modified under certain terms and conditions, but it
comes WITHOUT ANY WARRANTY; see the Design Science License for more
details.
Include a copy of the DSL with the distribution of the work.
Include the source data of the work (see the license text itself for the precise definition) with the
distribution, or make it available through postal mail for a cost not greater than storage media and
postage.
In many cases, the source data and the object form of a work will be the samethis is the case for
software programs written in the Perl language, for example. But often, the source data will differ
from a given object form. For example, when the object form is an MP3 format file made from a
WAV format sample of an analog source, the WAV sample is the source data. For a cropped and
manipulated JPEG file of a photograph obtained from a Kodak PhotoCD, the original PhotoCD file
is the source data.
By copylefting your work in this manner, you can make it available for the benefit of everyone
all copies and modifications of your work remain as equally free as the originalwhile attribution and
artistic integrity is guaranteed.
If you are interested in applying copyleft to your works, you might be interested in the following
sites:
Copyleft and the Information Renaissance (http://dsl.org/copyleft/), a general copyleft primer and collection of resources, written and maintained by the author.
Free Music Philosophy (http://ram.org/ramblings/philosophy/fmp.html), on the
free music movement, by Dr. Ram Samudrala.
What is Copyleft? (http://www.gnu.org/copyleft/), an explanation of copyleft as it
applies to computer software programs, by the GNU Project.
Program Index
.
.bash_logout . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
.bash_profile . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
.bashrc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
9
9wm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
A
Abbrev mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112
addgroup. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 318
adduser . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33, 318
ae . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107
afterstep . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
alias . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
amaya . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 296
amixer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 213
an . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 136
animate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 188
aplay . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 215
apropos . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26, 36, 37, 38
apt-get . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 316
arena . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 296
ascii . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104
aumix . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 217
aview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 188
B
balsa . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 283
banner . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 157, 178
bash . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33, 149
bbdb . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 258
bc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 261
biff . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 279
bitchx . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 311
BitchX . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 311
bitmap . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 199
browser-history. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 286
C
cal . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 252
calc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 261, 265
calendar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 254, 255, 256
can . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71
cat . . 72, 101, 103, 116, 133, 139, 145, 151, 157, 178, 201,
263, 320
cd . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62, 63
cd-circleprint . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 173
cdda2wav. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 221
cdeject . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 221
cdinfo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 220
cdir . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 220
cdlabelgen . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 173
cdparanoia . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 221
cdpause . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 219
cdplay . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 219
cdrecord. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 222
cdstop . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 220
cdtool . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 219
ce . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108
chcase. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69
chgrp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76
chmod . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77, 78
chrony . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 251
ci . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94
clear . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36, 43
cmp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91
co . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95
col . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 143
combine . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 195, 196
comm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
consolechars . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 177
convert . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 196, 204
cooledit. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107
cp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68, 72
crontab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 256
cse . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 179
cutup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 137
cvs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94
D
dadadodo. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 137
dap . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 230
date . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 251
dc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 265
dedit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107
del . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71
df . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 233
dia . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 199
diction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 127, 128
diff . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91, 134
diff3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91
dig . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 307
display . . . . . . . . . . . . . . . . . . . 184, 187, 194, 272, 273, 288
dissociated-press . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 137
dome . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 265
dpkg . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26, 316
drgeo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 199
dselect . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 316
dtm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 179
du. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87, 233
dvips. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 168, 172, 205, 240
dynamic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 223
E
echo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 277
ed . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 148
ee . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107
efax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 271
efix . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 273
electric. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 199
elm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 279, 283
elvis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107
emacs. . . 107, 108, 109, 111, 124, 134, 137, 143, 154, 254,
257, 258, 294
Emacs. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 135, 142, 239, 290
enlightenment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
enscript . . . . . . . . . . . . . 157, 159, 160, 162, 163, 289, 295
epic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 311
EPIC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 311
expand . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 141
express . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 296
F
factor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 264
faxon . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 272
fe . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107
festival. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 230
fg . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
figlet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34, 163, 178
file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89, 167, 168
filters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103
find . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81, 84, 87
finger . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 306, 307
flyspell-mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 124
fmt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 139, 140, 151
fonter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 179
freax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
free . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
freeamp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 217
freedraft . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 199
frm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 281
from . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 281
fromdos . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 248
ftp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 301
fvwm2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47, 49, 55, 56
fvwm95. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
G
Galeon . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 285
gawk . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116
gfont . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 179
gfontview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 179
ghostview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 159, 183, 205
gimp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 198, 204
GIMP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 194
H
hcopy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 247
hdel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 247
head . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101, 102
hformat . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 247
hfsutils. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 246
history . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
hls . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 246
hmount . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 246, 247
hostname . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22, 33, 36, 299
html2ps . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 295
I
idraw . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 199
Image Magick . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 189
imgsizer. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 295
import . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 201
info . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
ins . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 118
irssi . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 311
ispell . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122, 124
ivtools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 199
J
jed . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107
jobs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
joe . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107
K
kali . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 199
KDE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
kerberos. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 301
kill . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
knews . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 304
kraut . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103
L
last . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24, 319
latex. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 168, 169, 170, 172
leave . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 259
less . . . 37, 91, 99, 100, 102, 128, 145, 155, 214, 257, 279,
289, 295
licq . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 312
linux . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
ln . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71
locate. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81
logout . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19, 36
look . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 126, 127
lpq . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 238
lpr . . . . . . 141, 163, 168, 170, 237, 238, 239, 240, 242, 243
lprm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 239
ls. . . . . . . . . . . . . . . 43, 63, 64, 65, 67, 72, 76, 77, 86, 87, 235
lynx . . . . . 73, 115, 128, 153, 169, 276, 288, 289, 290, 292,
295
lyx . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 164
LyX . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 169, 239
M
m4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 118
magicfilter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 237
mail . . . . . . . . . . . . . . . . . . . 256, 259, 275, 276, 277, 278, 279
mailx . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 275
man . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26, 28, 104, 157, 243
maplay . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 217
mc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
mcopy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 245
mdel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 245
mdir . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 245
members . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
mesg . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 308
messages. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 280
metamail. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 282
metasend. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 282
mew . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 283
mformat . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 246
mh-e . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 283
micq . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 312
minicom . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 273
miscfiles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 130
mkdir . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62
mkisofs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 235
mogrify . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 189, 192, 194
montage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 195
moonlight . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 199
more . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99
mount . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 235, 236
mozilla . . . . . . . . . . . . 63, 73, 183, 187, 283, 285, 287, 304
mp3asm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 217
mpg321 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 215, 230
mtools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 245
mutt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 283
mv . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68, 72
mxv . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 230
N
nano . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
netpbm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
nl . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
nmh . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
nn . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
nngrep . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
notlame . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
number . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
107
189
145
283
304
305
229
265
O
oclock. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
openssh . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 299, 301
P
pan . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 304
passwd. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
patch . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91
pcdtoppm. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 203
pdf2ps . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 242
perl . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116, 136, 153
peruser . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 304
ping . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 305, 307
play . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 215
playmidi. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 216
plog . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 270
poff . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 270
pon . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 270
PostScript . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 173
ppmquant. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 192
pr . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 140, 141, 142, 143, 295
ps . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25, 39
ps2pdf . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 172, 209
psbook . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 207
psmerge . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 208
psnup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 207
psresize. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 208
psselect. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 206
pstoascii . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 209
psutils . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 205
pwd . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62, 63
random . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 263
rcs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94
rdjpgcom. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 194
rec . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 216
rel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 135
remembrance-agent . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 135
rev . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 146
rlog . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96
rm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70, 72, 84
rmdir . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70
rxvt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
tac . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 146
tail . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102
talk . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 309
tar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92
ted . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107
telnet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 299, 300
tex . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 167, 168, 169, 170
texinfo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 173
Texinfo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 169
the . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107
timidity. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 216
todos . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 248
top . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
touch . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62, 83, 89
tr . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12, 134, 151
tree . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66
twm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
S
saytime . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 252
scanimage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 202, 203
sced . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 199
script. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
sdiff . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91
sed . . . . . . . . . . . . . . . . . . . . . . . . . 102, 103, 116, 139, 140, 153
seq . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 263
sgml2html . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 172
sgml2info . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 172
sgml2latex . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 172
sgml2lyx. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 172
sgml2rtf. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 172
sgml2txt. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 172
sgml2xml. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 172
sgmlcheck . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 172
SGMLtools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 169, 170
sh . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
showcfont . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 177
showpicture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 188
shutdown . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
sigrot . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 283
Skipstone . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 285
sleep . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 260
slrn . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 304
snd . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 225
sort . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12, 87, 121, 134, 144
sox . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 226, 228, 230
spell. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121, 124, 127, 325
split . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90
startx. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
style . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 127, 129, 133
suggest . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 128
sview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103
U
ul . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 143
umount . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 235, 236
uname . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 319
unexpand. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 141
unhtml . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 295
uniq . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121, 134
units . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 264
uptime . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25, 319
V
vi . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107, 114
vim . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107
vm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 283
vrfy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 281
W
w . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
w3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 290
w3m . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 296
wall . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 308
wc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12, 87, 133, 134
weblint . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 296
wget . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 292, 293, 294
whatis. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
which . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88, 317
who . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12, 23
whoami . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23, 27
whois . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 308
wily . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107
wl . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 283
wm2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
wn . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125, 126
wnb . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125
word2x . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 248, 249
workbone. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 223
workman . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 223
write . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 308
wrjpgcom. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 194
wterm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
X
X11R6 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
xbiff . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 279
xcalc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 265
xcdroast. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 223
xchat . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 311
Xchat . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 311
xclock . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49, 52
xcolors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
xdm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
xdvi . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 168, 183
xedit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107
xemacs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108, 109
XEmacs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108, 290
xfd . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 177
xfig . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 199
xfontsel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51, 176
XFree86 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
xli . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 188
xlsfonts. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 176
xmms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 217
xmorph . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 199
xpaint . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 199
xpaste . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115
xpcd . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 187, 203
xpdf . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 184, 242
xsetroot . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
xterm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49, 54, 177, 240
xwave . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 230
xwd . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 188
xwud . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 188
Y
ytalk . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 309
Z
zcat . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116, 170, 173
zenirc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 311
ZenIRC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 311
zgrep . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 152, 286
zgv . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 186
zicq . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 312
zless . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99, 170
Concept Index
$
$Id$ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94
$MAIL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 277
*
*scratch* . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109
.
.bashrc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
.xsession . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55, 286
1
1984 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103
3
39 Steps, The . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
A
a safe way to remove a file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71
abbreviations, a list of common . . . . . . . . . . . . . . . . . . . . . . . 130
abbreviations, making in Emacs. . . . . . . . . . . . . . . . . . . . . . . 112
AbiWord . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 173
absolute file name . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
accent characters, inserting in Emacs . . . . . . . . . . . . . . . . . . 113
access modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76
accounts and privileges . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
acknowledgments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
active client . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
active job . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 238
adding borders to an image . . . . . . . . . . . . . . . . . . . . . . . . . . . 194
adding chorus to a sound file. . . . . . . . . . . . . . . . . . . . . . . . . . 228
adding echo to a sound file . . . . . . . . . . . . . . . . . . . . . . . . . . . 227
adding flange to a sound file . . . . . . . . . . . . . . . . . . . . . . . . . . 227
adding line breaks to text . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 140
adding margins to text . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 141
adding members to a group . . . . . . . . . . . . . . . . . . . . . . . . . . . 318
adding parameters to image tags . . . . . . . . . . . . . . . . . . . . . . 295
adding phase to a sound file. . . . . . . . . . . . . . . . . . . . . . . . . . . 228
adding reverb to a sound file . . . . . . . . . . . . . . . . . . . . . . . . . . 227
adding to your path . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
adding Vibro-Champ effects to a sound file . . . . . . . . . . . . 228
additional directory listing options . . . . . . . . . . . . . . . . . . . . . 67
additional image viewers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 188
additional PostScript output options . . . . . . . . . . . . . . . . . . . 163
adjusting the audio controls . . . . . . . . . . . . . . . . . . . . . . . . . . . 213
adjusting the colors of an image. . . . . . . . . . . . . . . . . . . . . . . 192
administrating users . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 318
administrative issues . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 315
Adobe Type 1 fonts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 179
B
background and history . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
background jobs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
background, putting a job in the . . . . . . . . . . . . . . . . . . . . . . . . 38
backups, making . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93
bang. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
base file name. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
basic commands and concepts . . . . . . . . . . . . . . . . . . . . . . . . . 17
basic Emacs editing keys . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111
bass, adjusting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 213
BBS, connecting to a . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 273
bell character . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
Bell Labs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
Biff . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 279
binaries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 315
bitmaps . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
Bluefish . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 294
booklet, arranging a PostScript document in a. . . . . . . . . . 208
booklets, printing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 163
booting the system . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
borders, adding to images . . . . . . . . . . . . . . . . . . . . . . . . . . . . 194
Bourne, Steve . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
Browne, Christopher B. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 157
browsing directories . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
browsing files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73
browsing image collections in X . . . . . . . . . . . . . . . . . . . . . . 186
browsing images in a console . . . . . . . . . . . . . . . . . . . . . . . . . 186
browsing PhotoCD archives . . . . . . . . . . . . . . . . . . . . . . . . . . 187
browsing text, options available while . . . . . . . . . . . . . . . . . 290
browsing the Web . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 285
browsing the Web in Emacs . . . . . . . . . . . . . . . . . . . . . . . . . . 290
browsing tips, for Mozilla . . . . . . . . . . . . . . . . . . . . . . . . . . . . 287
BSD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
buffer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109
Bulletin Board System (BBS) . . . . . . . . . . . . . . . . . . . . . . . . . 273
Burroughs, William S.. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 136
C
Cable Modem Providers HOWTO . . . . . . . . . . . . . . . . . . . . 269
calculating arithmetic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 261
calendar file, making . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 255
calendar files, including . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 255
calendar, displaying a . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 252
calendar, displaying in Emacs. . . . . . . . . . . . . . . . . . . . . . . . . 254
calendars . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 252
calling out on a modem. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 273
cancelling a print job . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 239
capture logs. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
D
DAP (Digital Audio Processor) . . . . . . . . . . . . . . . . . . . . . . . 230
data CDs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 236
date, displaying the . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 251
Davis, John E. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107
Debian . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
Debian Free Software Guidelines (DFSG) . . . . . . . . . . . . . . 10
Debian GNU/Linux . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 321
Debian package, installing a . . . . . . . . . . . . . . . . . . . . . . . . . . 316
Debian package, upgrading a . . . . . . . . . . . . . . . . . . . . . . . . . 316
Debian, getting and installing . . . . . . . . . . . . . . . . . . . . . . . . . 316
Debian, what version am I running? . . . . . . . . . . . . . . . . . . . 320
decompressing a file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92
DEdit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107
definitions, of words . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 126
delay, running a command on a . . . . . . . . . . . . . . . . . . . . . . . 260
deleting files and directories . . . . . . . . . . . . . . . . . . . . . . . . . . . 70
deleting files on a DOS disk . . . . . . . . . . . . . . . . . . . . . . . . . . 245
deleting files on a Macintosh disk . . . . . . . . . . . . . . . . . . . . . 247
deleting mail . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 278
Dell Computer Corporation . . . . . . . . . . . . . . . . . . . . . . . . . . . 315
dependencies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 316
Design Science License (DSL) . . . . . . . . . . . . . . . . . . . . . . . . 323
desktop . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
desktop environment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
desktop, moving around the . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
destroying a window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
determining file type and format . . . . . . . . . . . . . . . . . . . . . . . 89
determining the ownership of a file . . . . . . . . . . . . . . . . . . . . . 76
determining whether two files differ . . . . . . . . . . . . . . . . . . . . 91
DFSG . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
dialects, outputting text in . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103
DICT Development Group . . . . . . . . . . . . . . . . . . . . . . . . . . . 127
diction, checking. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 128
dictionaries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125
dictionaries, online . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 127
dictionary, personal . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122
dictionary, searching for words in the. . . . . . . . . . . . . . . . . . 126
difference report . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91
difference report, patching a file with a . . . . . . . . . . . . . . . . . 91
directories . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
directories, changing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62
directories, copying . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68
directories, finding the largest . . . . . . . . . . . . . . . . . . . . . . . . . . 87
directories, finding the smallest . . . . . . . . . . . . . . . . . . . . . . . . 87
directories, listing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
directories, listing hidden . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
directories, listing in color . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66
directories, listing options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67
directories, listing tree graphs of . . . . . . . . . . . . . . . . . . . . . . . 66
directories, making . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62
directories, moving . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68
directories, naming . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
directories, removing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70
directories, renaming . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68
directory listings, finding files in . . . . . . . . . . . . . . . . . . . . . . . 86
directory tree . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
directory tree, finding files in a . . . . . . . . . . . . . . . . . . . . . . . . . 81
directory tree, making a . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62
directory, changing to the last one you visited . . . . . . . . . . . 63
directory, finding the largest files in a . . . . . . . . . . . . . . . . . . . 86
directory, finding the smallest files in a . . . . . . . . . . . . . . . . . 86
disk storage. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 233
disk usage, listing a files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 233
disk, listing the free space on a . . . . . . . . . . . . . . . . . . . . . . . . 233
diskettes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 234
disks, floppy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 234
displaying a calendar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 252
displaying a calendar in Emacs . . . . . . . . . . . . . . . . . . . . . . . 254
displaying information about an audio CD . . . . . . . . . . . . . 220
displaying information about the system . . . . . . . . . . . . . . . 319
displaying the characters in a console font . . . . . . . . . . . . . 177
displaying the characters in an X font . . . . . . . . . . . . . . . . . 177
displaying the date and time . . . . . . . . . . . . . . . . . . . . . . . . . . 251
distribution, defined . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
document processing, with LyX . . . . . . . . . . . . . . . . . . . . . . . 164
Document Type Definition (DTD). . . . . . . . . . . . . . . . . . . . . 170
documentation, system . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
domain name, listing the owner of a . . . . . . . . . . . . . . . . . . . 308
domain record . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 308
DOS disk, copying files to and from a . . . . . . . . . . . . . . . . . 245
DOS disk, deleting files on a . . . . . . . . . . . . . . . . . . . . . . . . . . 245
DOS disk, formatting a . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 246
DOS disk, listing the contents of a . . . . . . . . . . . . . . . . . . . . 245
DOS disk, using . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 245
DOS text files, converting . . . . . . . . . . . . . . . . . . . . . . . . . . . . 248
dot files. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
double-spacing text . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 140
doubled words, checking text for . . . . . . . . . . . . . . . . . . . . . . 128
downloading a file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 303
drives, letting users mount . . . . . . . . . . . . . . . . . . . . . . . . . . . . 319
DSL (Design Science License) . . . . . . . . . . . . . . . . . . . . . . . . 323
DSL HOWTO for Linux . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 269
DTD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 170
Duggan, Angus . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 205
Duke of URL, The . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 315, 321
DVI file, preparing for printing . . . . . . . . . . . . . . . . . . . . . . . 241
DVI file, previewing a . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 183
DVI files, printing. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 240
DVI pages, extracting to PostScript . . . . . . . . . . . . . . . . . . . 205
Dvips, printing with . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 240
E
echo area . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109
echo, adding to a sound file . . . . . . . . . . . . . . . . . . . . . . . . . . . 227
editing images . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 189
editing images with the GIMP . . . . . . . . . . . . . . . . . . . . . . . . 198
editing sound files. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 225
editing streams of text . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116
editing text . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107
edition of the Cookbook, latest . . . . . . . . . . . . . . . . . . . . . . . . . . 4
editors, text . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107
effects, sound . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 226
ejecting an audio CD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 221
electronic mail . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 275
elements of an SGML document . . . . . . . . . . . . . . . . . . . . . . 171
Elements of Style. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 128
eliminating extra spaces in text . . . . . . . . . . . . . . . . . . . . . . . 139
Emacs . . . . . . . . . . . . . . . . . . . . . . . . 33, 107, 108, 143, 283, 294
Emacs diary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 254
Emacs, basic editing keys . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111
Emacs, browsing the Web in . . . . . . . . . . . . . . . . . . . . . . . . . . 290
Emacs, counting lines per page in . . . . . . . . . . . . . . . . . . . . . 134
Emacs, displaying a calendar in . . . . . . . . . . . . . . . . . . . . . . . 254
Emacs, getting acquainted with . . . . . . . . . . . . . . . . . . . . . . . 109
Emacs, inserting special characters in . . . . . . . . . . . . . . . . . 113
Emacs, listing relevant files in . . . . . . . . . . . . . . . . . . . . . . . . 135
Emacs, making abbreviations in. . . . . . . . . . . . . . . . . . . . . . . 112
Emacs, making cut-ups in . . . . . . . . . . . . . . . . . . . . . . . . . . . . 137
Emacs, printing in . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 239
Emacs, recording and running macros in . . . . . . . . . . . . . . 112
Emacs, searching and replacing in . . . . . . . . . . . . . . . . . . . . 155
Emacs, searching for a phrase in . . . . . . . . . . . . . . . . . . . . . . 154
Emacs, searching for a regexp in . . . . . . . . . . . . . . . . . . . . . . 155
Emacs, searching incrementally in . . . . . . . . . . . . . . . . . . . . 154
Emacs, searching text in . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 154
Emacs, spell checking in . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 124
email . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 275
email addresses, verifying . . . . . . . . . . . . . . . . . . . . . . . . . . . . 281
email reminders, sending yourself . . . . . . . . . . . . . . . . . . . . . 259
email signature, making an . . . . . . . . . . . . . . . . . . . . . . . . . . . 283
empty file, making an . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62
empty files, finding in a directory tree . . . . . . . . . . . . . . . . . . 82
Encapsulated PostScript . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 205
encryption, connecting to another system with . . . . . . . . . 301
envelopes, printing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 240
EPS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 205
EPS file, previewing a . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 183
errata . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
error messages, redirecting to a file . . . . . . . . . . . . . . . . . . . . . 37
etext . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
event number . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
event, history . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
exclusions to the Cookbook . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
execute permission . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76
expansions, file name . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
F
fancy headers, outputting text with . . . . . . . . . . . . . . . . . . . . 162
Fannin, David . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 269
FAQs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
fax format, converting to and from . . . . . . . . . . . . . . . . . . . . 273
fax, receiving a . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 272
fax, sending a . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 271
faxes, receiving automatically. . . . . . . . . . . . . . . . . . . . . . . . . 272
faxing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 271
features of LyX . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 165
Festival. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 230
FILE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 127
file archives . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92
file attributes, listing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64
file compression. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92
file formats, sound . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 213
file modification time, changing . . . . . . . . . . . . . . . . . . . . . . . . 89
file names, changing to lowercase . . . . . . . . . . . . . . . . . . . . . . 69
file names, specifying with patterns . . . . . . . . . . . . . . . . . . . . 72
file ownership . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76
file permissions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76
file revisions, checking in . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94
file revisions, checking out . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95
file, appending text to a . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117
file, changing the ownership of a . . . . . . . . . . . . . . . . . . . . . . . 76
file, changing the permissions of a. . . . . . . . . . . . . . . . . . . . . . 77
file, determining the ownership of a . . . . . . . . . . . . . . . . . . . . 76
file, inserting text at the beginning of a . . . . . . . . . . . . . . . . 118
file, listing disk usage of a . . . . . . . . . . . . . . . . . . . . . . . . . . . . 233
file, listing the permissions of a . . . . . . . . . . . . . . . . . . . . . . . . 77
file, mailing a . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 276
file, making a private . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78
file, making a public . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78
file, making an executable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78
file, perusing a text . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99
file, redirecting error messages to a . . . . . . . . . . . . . . . . . . . . . 37
file, redirecting input to a . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
file, redirecting output to a . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
file, saving a URL to a. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 293
files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57, 59
files and directories. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
files, archiving . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92
files, browsing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73
files, comparing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90
files, compressing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92
files, controlling access to . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76
files, converting Microsoft Word . . . . . . . . . . . . . . . . . . . . . . 248
files, copying . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68
files, creating . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89
files, creating an archive of . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93
files, decompressing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92
files, determining type and format of . . . . . . . . . . . . . . . . . . . 89
files, determining whether two differ . . . . . . . . . . . . . . . . . . . 91
files, dot . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
files, downloading . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 303
files, executable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78
files, finding all that match a pattern . . . . . . . . . . . . . . . . . . . . 81
files, finding in a directory tree . . . . . . . . . . . . . . . . . . . . . . . . . 81
files, finding in a directory tree by modification time. . . . . 83
files, finding in a directory tree by name . . . . . . . . . . . . . . . . 81
files, finding in a directory tree by owner . . . . . . . . . . . . . . . 84
files, finding in a directory tree by size . . . . . . . . . . . . . . . . . . 82
files, finding in listings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86
files, finding text in. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 147
files, finding the differences between . . . . . . . . . . . . . . . . . . . 91
files, finding the largest in a directory . . . . . . . . . . . . . . . . . . . 86
files, finding the number of in a listing . . . . . . . . . . . . . . . . . . 87
files, finding the smallest . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86
files, getting from the Web . . . . . . . . . . . . . . . . . . . . . . . . . . . . 292
files, giving more than one name . . . . . . . . . . . . . . . . . . . . . . . 71
files, hidden. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
files, linking . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71
files, listing newest first . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
files, listing recursively . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
files, listing the misspellings in . . . . . . . . . . . . . . . . . . . . . . . 121
files, making empty . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62
files, managing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89
files, moving . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68
files, naming . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
files, perusing multiple text . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99
files, preparing for printing . . . . . . . . . . . . . . . . . . . . . . . . . . . 240
files, previewing print . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 183
files, printing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 237
files, read only . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78
files, removing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70
files, removing those with strange names . . . . . . . . . . . . . . . 70
files, renaming . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68
files, renaming multiple. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69
files, searching more than plain text . . . . . . . . . . . . . . . . . . . 152
files, sharing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
files, sound . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 213
files, splitting into smaller . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90
files, touching . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89
files, tracking revisions to . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94
files, transferring large . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90
files, transferring with another system . . . . . . . . . . . . . . . . . 301
files, uploading . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 302
files, world readable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78
files, world writable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78
files, write-protecting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78
files, writing text to . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117
filesystem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 233
filter, defined . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103
FQDN . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
frames, window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47, 53
Free Journalism Dictionary . . . . . . . . . . . . . . . . . . . . . . . . . . . 127
Free Music Philosophy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 325
free software . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
Free Software Foundation . . . . . . . . . . . . . . . . . . . . . . . . . 29, 321
free-form address list, keeping a . . . . . . . . . . . . . . . . . . . . . . 257
Free-Net. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108
FreeAmp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 217
Freshmeat . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 321
Friedman, Noah. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 279
fstab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 319
full path name . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
Fuller, R. Buckminster . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
G
gamma correction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 192
generating output from SGML . . . . . . . . . . . . . . . . . . . . . . . . 172
getting acquainted with Emacs . . . . . . . . . . . . . . . . . . . . . . . . 109
getting and installing Debian . . . . . . . . . . . . . . . . . . . . . . . . . 316
getting files from the Web . . . . . . . . . . . . . . . . . . . . . . . . . . . . 292
getting the name of the current directory . . . . . . . . . . . . . . . . 63
Ghostscript . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 205, 209
GIMP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 196, 204
GIMP, editing images with the . . . . . . . . . . . . . . . . . . . . . . . . 198
giving a file more than one name . . . . . . . . . . . . . . . . . . . . . . . 71
GNOME . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 283, 296
GNU Awk Users Guide, The . . . . . . . . . . . . . . . . . . . . . . . . . 116
GNU Emacs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108
GNU Info System, using the . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
GNU Manifesto. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 130
GNU Project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10, 127, 321
GNU/Linux . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
GnuCash . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 265
Gnus . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 304
grammar and reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121
grammar, checking . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 127
GramoFile . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 230
graphic files, viewing. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 183
Greenspun, Philip . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 204
group, listing the members of a . . . . . . . . . . . . . . . . . . . . . . . . 75
groups and how to work in them . . . . . . . . . . . . . . . . . . . . . . . 75
groups, adding members to . . . . . . . . . . . . . . . . . . . . . . . . . . . 318
groups, listing. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
Gysin, Brion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 136
H
Haardt, Michael. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 127
hard links . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71
hardware compatibility, Linux and . . . . . . . . . . . . . . . . . . . . 315
hardware peripherals, letting users access . . . . . . . . . . . . . . 318
hat notation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101
I
IBM Corporation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 315
ICQ, chatting with users on . . . . . . . . . . . . . . . . . . . . . . . . . . . 312
if you need more help . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
image editors and tools, interactive . . . . . . . . . . . . . . . . . . . . 199
Image Magick . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 184
image tags, adding parameters to . . . . . . . . . . . . . . . . . . . . . . 295
image viewers, additional. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 188
image, scanning an . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 203
Images . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 181
images, adding borders to . . . . . . . . . . . . . . . . . . . . . . . . . . . . 194
images, adjusting colors of . . . . . . . . . . . . . . . . . . . . . . . . . . . 192
images, annotating . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 194
images, browsing in X. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 186
images, changing the size of . . . . . . . . . . . . . . . . . . . . . . . . . . 189
images, combining . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 195
images, combining in montages . . . . . . . . . . . . . . . . . . . . . . . 195
images, converting between formats . . . . . . . . . . . . . . . . . . . 196
images, editing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 189
images, importing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 201
images, morphing two together . . . . . . . . . . . . . . . . . . . . . . . 196
J
Jan, Dr. Lee Su . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
job number . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
job, printing multiple copies of a . . . . . . . . . . . . . . . . . . . . . . 238
jobs, background . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
jobs, foreground . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
jobs, killing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
jobs, listing your . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
jobs, managing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
jobs, suspending . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
Joy, Bill . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 279
K
keeping a contact manager database . . . . . . . . . . . . . . . . . . . 258
keeping a free-form address list . . . . . . . . . . . . . . . . . . . . . . . 257
keeping a spelling word list . . . . . . . . . . . . . . . . . . . . . . . . . . . 122
kernel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
kernel, defined . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
Kernighan, Brian . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
keys for command line editing . . . . . . . . . . . . . . . . . . . . . . . . . 33
keys for console manipulation. . . . . . . . . . . . . . . . . . . . . . . . . . 21
killing text . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115
Knuth, Donald . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 167
Kvaleberg, Egil . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 269
L
landscape orientation, outputting text in . . . . . . . . . . . . . . . 163
language highlighting, outputting text with . . . . . . . . . . . . 161
lanscape orientation, PostScript pages in. . . . . . . . . . . . . . . 207
LaStrange, Tom . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
LaTeX . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 143, 157, 167
LaTeX files, processing. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 168
LaTeX, determining format . . . . . . . . . . . . . . . . . . . . . . . . . . . 168
LaTeX, writing documents with . . . . . . . . . . . . . . . . . . . . . . . 169
learning more about LyX . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 166
leave, reminding yourself when you have to . . . . . . . . . . . 259
less, searching text in. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 155
letting the shell complete what you type . . . . . . . . . . . . . . . . 35
letting users access hardware peripherals . . . . . . . . . . . . . . 318
letting users mount drives . . . . . . . . . . . . . . . . . . . . . . . . . . . . 319
lexicons . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 127
license . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 323
Licq. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 312
line breaks, adding to text . . . . . . . . . . . . . . . . . . . . . . . . . . . . 140
line printer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 237
lines beginning with certain text, matching . . . . . . . . . . . . 149
lines ending with certain text, matching . . . . . . . . . . . . . . . 150
lines of a certain length, matching . . . . . . . . . . . . . . . . . . . . . 150
lines per page, counting in Emacs . . . . . . . . . . . . . . . . . . . . . 134
lines, counting in a text . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133
lines, matching that only contain certain characters . . . . . 151
lines, showing the ends of . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101
links. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71
Linux . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
Linux and hardware compatibility . . . . . . . . . . . . . . . . . . . . . 315
Linux Gazette . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 321
Linux Mandrake . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 321
Linux Network Administrators Guide, The . . . . . . . . . . . 269
Linux resources on the Web . . . . . . . . . . . . . . . . . . . . . . . . . . 321
Linux User Groups (LUGs) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
Linux Weekly News. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 321
Linux, what version am I running? . . . . . . . . . . . . . . . . . . . . 319
listing a description of a program. . . . . . . . . . . . . . . . . . . . . . . 27
listing a disks free space . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 233
listing a files disk usage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 233
M
Macintosh disk, copying files to and from a . . . . . . . . . . . . 247
Macintosh disk, deleting files on a . . . . . . . . . . . . . . . . . . . . 247
Macintosh disk, formatting a. . . . . . . . . . . . . . . . . . . . . . . . . . 247
Macintosh disk, listing the contents of a . . . . . . . . . . . . . . . 246
Macintosh disk, specifying . . . . . . . . . . . . . . . . . . . . . . . . . . . 246
Macintosh disk, using . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 246
macros, recording and running in Emacs . . . . . . . . . . . . . . 112
Magnusson, Bjorn . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 170
mail application, picking the right . . . . . . . . . . . . . . . . . . . . . 283
mail attachment, reading a . . . . . . . . . . . . . . . . . . . . . . . . . . . . 282
mail attachment, sending a. . . . . . . . . . . . . . . . . . . . . . . . . . . . 282
mail attachments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 281
mail folder . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 279
mail folder, viewing a . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 279
mail notification, setting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 279
mail user agents. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 275
mail, counting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 280
mail, deleting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 278
mail, electronic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 275
mail, managing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 279
mail, options available while reading . . . . . . . . . . . . . . . . . . 278
mail, receiving . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 277
mail, seeing who yours is from. . . . . . . . . . . . . . . . . . . . . . . . 281
mail, sending . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 275
mail, special composition keystrokes . . . . . . . . . . . . . . . . . . 276
mailing a user on the same system . . . . . . . . . . . . . . . . . . . . 275
mailing files or the output of commands . . . . . . . . . . . . . . . 276
mailing the contents of a URL . . . . . . . . . . . . . . . . . . . . . . . . 276
maintaining a list of visited Web sites . . . . . . . . . . . . . . . . . 286
making a command alias . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
making a concordance of a text . . . . . . . . . . . . . . . . . . . . . . . 134
making a directory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62
making a directory tree . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62
making a file executable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78
making a file private . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78
making a file public . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78
making a quick arithmetic calculation . . . . . . . . . . . . . . . . . 261
making a text banner . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 178
making a user account . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 318
making abbreviations in Emacs . . . . . . . . . . . . . . . . . . . . . . . 112
making an appointment file . . . . . . . . . . . . . . . . . . . . . . . . . . . 255
making an email signature . . . . . . . . . . . . . . . . . . . . . . . . . . . . 283
making an empty file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62
making an image montage . . . . . . . . . . . . . . . . . . . . . . . . . . . . 195
making an MP3 file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 229
making and managing print jobs . . . . . . . . . . . . . . . . . . . . . . 237
making cut-ups in Emacs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 137
making many arithmetic calculations . . . . . . . . . . . . . . . . . . 261
making random word cut-ups . . . . . . . . . . . . . . . . . . . . . . . . . 137
making simple text cut-ups . . . . . . . . . . . . . . . . . . . . . . . . . . . 137
man pages, preparing for printing . . . . . . . . . . . . . . . . . . . . . 243
managing appointments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 254
managing files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89
managing jobs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
managing mail . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 279
manipulating PostScript documents . . . . . . . . . . . . . . . . . . . 207
manipulating PostScript pages . . . . . . . . . . . . . . . . . . . . . . . . 205
manipulating X client windows . . . . . . . . . . . . . . . . . . . . . . . . 52
manual pages, reading . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
manual pages, searching . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
margins, adding to text . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 141
mark . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115
Massachusetts Institute of Technology . . . . . . . . . . . . . . . . . . 10
matching lines beginning with certain text . . . . . . . . . . . . . 149
matching lines ending with certain text . . . . . . . . . . . . . . . . 150
matching lines in compressed files . . . . . . . . . . . . . . . . . . . . 152
matching lines in Web pages . . . . . . . . . . . . . . . . . . . . . . . . . . 153
matching lines of a certain length . . . . . . . . . . . . . . . . . . . . . 150
matching lines that contain all of some regexps . . . . . . . . 150
matching lines that contain any of some regexps . . . . . . . 150
matching lines that dont contain a regexp . . . . . . . . . . . . . 151
matching lines that only contain certain characters . . . . . 151
matching text patterns with regular expressions . . . . . . . . 148
math tools, other . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 265
mathematics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 261
maximizing a window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
Maxwell. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 173
measurement, converting an amount between units of . . 264
members of a group, listing . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
menu bar, in Emacs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109
message of the day . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
messages, counting how many you have . . . . . . . . . . . . . . . 280
messages, sending to another users terminal . . . . . . . . . . . 308
Metafont . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 167
Micq . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 312
micro-editing, text . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117
microphone, selecting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 215
Microsoft Word files, converting . . . . . . . . . . . . . . . . . . . . . . 248
Microsoft Word files, reading . . . . . . . . . . . . . . . . . . . . . . . . . 173
MIDI file, playing a . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 216
Midnight Commander . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63, 107
Midnight Macros . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 170
MIME . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 281
minibuffer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109
minimizing a window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
Minix . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
mirroring an entire Web site . . . . . . . . . . . . . . . . . . . . . . . . . . 293
mixers, audio . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 213
mixing sound files together . . . . . . . . . . . . . . . . . . . . . . . . . . . 226
MiXViews. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 230
mode line. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109
modem, calling out on a . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 273
modem, permitting user access to . . . . . . . . . . . . . . . . . . . . . 318
monochrome, transforming color images to . . . . . . . . . . . . 192
montages, making image . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 195
more recipes for printing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 239
more Web browsers and tools . . . . . . . . . . . . . . . . . . . . . . . . . 296
morphing two images together . . . . . . . . . . . . . . . . . . . . . . . . 196
Mosaic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 285
motd . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
mounting a CD-ROM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 236
mounting a floppy disk . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 235
moving a window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
moving around the desktop . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
moving files and directories . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68
Mozilla . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63, 304
Mozilla browsing tips . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 287
Mozilla, browsing the Web with . . . . . . . . . . . . . . . . . . . . . . 285
Mozilla, running from a script . . . . . . . . . . . . . . . . . . . . . . . . 287
MP3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 217
MP3 file, making an. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 229
MP3 file, playing an. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 215
MP3, converting to another format . . . . . . . . . . . . . . . . . . . . 230
MUAs. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 275
Multics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
multisession CD-Rs, burning . . . . . . . . . . . . . . . . . . . . . . . . . 222
Muss, Mike . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 305
muting an audio device . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 214
N
National Weather Service, city codes for. . . . . . . . . . . . . . . 130
NetBSD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
netnews . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 303
Netscape . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 285
Network Time Protocol (NTP) . . . . . . . . . . . . . . . . . . . . . . . . 251
Networking . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 267
News Peruser . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 304
newsgroups, finding for a topic . . . . . . . . . . . . . . . . . . . . . . . 305
newsreader, choosing a . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 304
non-printing characters, showing . . . . . . . . . . . . . . . . . . . . . . 101
notification for new mail, setting . . . . . . . . . . . . . . . . . . . . . . 279
numbering lines of text . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 145
numbers, converting. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 264
numbers, listing a sequence of . . . . . . . . . . . . . . . . . . . . . . . . 263
numeral, converting an Arabic to English . . . . . . . . . . . . . . 265
O
occurrences of something, counting the. . . . . . . . . . . . . . . . 134
Ogg Vorbis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 217
online dictionaries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 127
Open Sound System. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 213
Open Source . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
Open Source Initiative (OSI) . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
open source software . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
OpenBSD. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
opening a URL from a script. . . . . . . . . . . . . . . . . . . . . . . . . . 287
operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77
options available when paginating text . . . . . . . . . . . . . . . . 143
options available while browsing text. . . . . . . . . . . . . . . . . . 290
options available while reading mail. . . . . . . . . . . . . . . . . . . 278
options, long-style . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
Orwell, George . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103
OSI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
OSS/Linux . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 213
other audio CD applications . . . . . . . . . . . . . . . . . . . . . . . . . . 223
other font tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 179
other internet services . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 299
other math tools. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 265
other sound file tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 217
other tools for sound editing . . . . . . . . . . . . . . . . . . . . . . . . . . 230
other word processors and typesetting systems . . . . . . . . . 173
output, redirecting. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
outputting a beginning part of a text . . . . . . . . . . . . . . . . . . . 101
outputting a middle part of a text . . . . . . . . . . . . . . . . . . . . . . 102
outputting a random number . . . . . . . . . . . . . . . . . . . . . . . . . . 263
outputting an ending part of a text . . . . . . . . . . . . . . . . . . . . . 102
outputting multiple copies of text . . . . . . . . . . . . . . . . . . . . . 163
outputting text . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101
outputting text as a poster or sign . . . . . . . . . . . . . . . . . . . . . 160
outputting text in a dialect . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103
outputting text in a font. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 159
outputting text in landscape orientation . . . . . . . . . . . . . . . . 163
outputting text with fancy headers . . . . . . . . . . . . . . . . . . . . . 162
outputting text with language highlighting . . . . . . . . . . . . . 161
outputting the context of a search . . . . . . . . . . . . . . . . . . . . . 153
outputting the text between strings . . . . . . . . . . . . . . . . . . . . 103
Overwrite mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109
ownership of a file, changing the . . . . . . . . . . . . . . . . . . . . . . . 76
ownership of a file, determining the . . . . . . . . . . . . . . . . . . . . 76
ownership, of files. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76
P
package, installing a Debian . . . . . . . . . . . . . . . . . . . . . . . . . . 316
package, upgrading a Debian . . . . . . . . . . . . . . . . . . . . . . . . . 316
page breaks, inserting in a text file . . . . . . . . . . . . . . . . . . . . 113
pager . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47, 53
pages, extracting from a PostScript file . . . . . . . . . . . . . . . . 206
paginating text . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 142
paginating text, options available when . . . . . . . . . . . . . . . . 143
paging through a file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99
paging through multiple files . . . . . . . . . . . . . . . . . . . . . . . . . . . 99
palindromes, finding in text . . . . . . . . . . . . . . . . . . . . . . . . . . . 136
passing special characters to commands . . . . . . . . . . . . . . . . 34
password, changing your . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
password, choosing a . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
pasting a selection of sound. . . . . . . . . . . . . . . . . . . . . . . . . . . 226
pasting text . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115
patching a file with a difference report . . . . . . . . . . . . . . . . . . 91
path . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
path name . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
path, adding to . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
pattern, finding all files that match a . . . . . . . . . . . . . . . . . . . . 81
patterns, file name . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
Q
quantizing images . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 192
Quarter Century of UNIX, A . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
quoting characters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
R
random number, outputting a . . . . . . . . . . . . . . . . . . . . . . . . . 263
rapid serial visual presentation (RSVP) . . . . . . . . . . . . . . . . 103
RCS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94
read permission . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76
readability, checking text for . . . . . . . . . . . . . . . . . . . . . . . . . . 129
reading a mail attachment . . . . . . . . . . . . . . . . . . . . . . . . . . . . 282
reading a page from the system manual . . . . . . . . . . . . . . . . . 28
reading mail, options available while . . . . . . . . . . . . . . . . . . 278
reading system documentation and help files . . . . . . . . . . . . 31
reading text from the Web . . . . . . . . . . . . . . . . . . . . . . . . . . . . 288
reading the headers of a web page . . . . . . . . . . . . . . . . . . . . . 294
reading Usenet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 303
receiving a fax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 272
receiving faxes automatically . . . . . . . . . . . . . . . . . . . . . . . . . 272
receiving mail . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 277
recipes, definition of . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
recipes, format of. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
recording a shell session . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
recording a sound file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 216
recording and running macros in Emacs . . . . . . . . . . . . . . . 112
recording source, selecting an audio . . . . . . . . . . . . . . . . . . . 215
Red Hat . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
Red Hat Linux . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 321
redirecting error messages to a file . . . . . . . . . . . . . . . . . . . . . 37
redirecting input and output . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
redirecting input to a file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
redirecting output to a file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
redirecting output to another commands input . . . . . . . . . . 37
reference files. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 130
reference, tools for . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121
regexp, matching lines that dont contain a. . . . . . . . . . . . . 151
regexps . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 148
regexps for common situations . . . . . . . . . . . . . . . . . . . . . . . . 152
regexps, matching lines that contain all of some . . . . . . . . 150
regexps, matching lines that contain any of some . . . . . . . 150
regexps, searching for in Emacs . . . . . . . . . . . . . . . . . . . . . . . 155
regexps, using a list to match from . . . . . . . . . . . . . . . . . . . . 152
register labels, LaTeX templates for . . . . . . . . . . . . . . . . . . . 170
regular expressionsmatching text patterns . . . . . . . . . . . 148
relevant text, finding . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 134
reminders . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 251
reminders, including holidays in your . . . . . . . . . . . . . . . . . 255
S
SAL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 321
Salus, Peter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
sampling rate of a sound file, changing the . . . . . . . . . . . . . 227
sampling sound from a CD . . . . . . . . . . . . . . . . . . . . . . . . . . . 221
Samudrala, Ram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 325
SANE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 202
saving a URL to a file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 293
scaling image size. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 189
T
tab and space characters, swapping . . . . . . . . . . . . . . . . . . . . 141
tab characters, showing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101
tab completion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
taking a screen shot in a console . . . . . . . . . . . . . . . . . . . . . . 201
taking a screen shot in x . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 201
taking screen shots . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 201
tarballs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92
telephone codes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 130
teletype . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
Telix . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 273
templates, TEX and LaTeX. . . . . . . . . . . . . . . . . . . . . . . . . . . . 170
terminals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
testing a scanner . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 203
TeX . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 143
TEX . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 167
TEX and LaTeX document templates . . . . . . . . . . . . . . . . . . 170
TEX Catalogue Online . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 170
TEX files, processing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 168
TEX, determining format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 168
TEX, writing documents with . . . . . . . . . . . . . . . . . . . . . . . . . 169
Texinfo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 157
Text . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97
text banner, making a. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 178
text cut-ups . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 136
text editing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107
text editor, choosing a . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107
text files, converting between DOS and Linux. . . . . . . . . . 248
text files, including . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 118
text fonts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 178
text fonts, horizonal . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 178
text relevance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 134
text, adding line breaks to . . . . . . . . . . . . . . . . . . . . . . . . . . . . 140
text, adding margins to . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 141
text, analyzing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133
text, appending to a file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117
text, checking for difficult sentences. . . . . . . . . . . . . . . . . . . 129
text, checking for doubled words . . . . . . . . . . . . . . . . . . . . . . 128
text, checking for long sentences . . . . . . . . . . . . . . . . . . . . . . 129
text, checking for misused phrases . . . . . . . . . . . . . . . . . . . . 128
text, checking for readability. . . . . . . . . . . . . . . . . . . . . . . . . . 129
text, concatenating . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116
text, converting to PostScript . . . . . . . . . . . . . . . . . . . . . . . . . 159
text, counting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133
text, counting the characters in a . . . . . . . . . . . . . . . . . . . . . . 133
text, counting the lines in a . . . . . . . . . . . . . . . . . . . . . . . . . . . 133
text, counting the words in a . . . . . . . . . . . . . . . . . . . . . . . . . . 133
text, counting unique words in . . . . . . . . . . . . . . . . . . . . . . . . 134
text, cutting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115
text, determining if two differ . . . . . . . . . . . . . . . . . . . . . . . . . . 91
text, double-spacing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 140
text, editing streams of . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116
text, eliminating extra spaces in . . . . . . . . . . . . . . . . . . . . . . . 139
text, finding anagrams in . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 136
U
underlining text . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113, 143
underscores . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 289
units of measurement, converting an amount between . . 264
University of Southern California-Berkeley . . . . . . . . . . . . . . 9
University of Washington. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107
Unix . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9, 10
Unix and the tools philosophy. . . . . . . . . . . . . . . . . . . . . . . . . . 12
UNIX Environment, The . . . . . . . . . . . . . . . . . . . . . . . . . . 12, 128
unmounting a CD-ROM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 236
unmounting a floppy disk . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 235
unused files, finding in a directory tree. . . . . . . . . . . . . . . . . . 83
upgrading a Debian package . . . . . . . . . . . . . . . . . . . . . . . . . . 316
uploading a file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 302
URL, mailing the contents of a. . . . . . . . . . . . . . . . . . . . . . . . 276
URL, saving to a file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 293
Usenet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 303
user account, making a . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 318
user accounts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
user activity, listing. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
user groups, for Linux . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
user privileges . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
user, chatting directly with a . . . . . . . . . . . . . . . . . . . . . . . . . . 309
user, checking whether one is online . . . . . . . . . . . . . . . . . . 306
username . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
username, listing your . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
users, administrating . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 318
users, chatting with on ICQ . . . . . . . . . . . . . . . . . . . . . . . . . . . 312
users, chatting with on IRC . . . . . . . . . . . . . . . . . . . . . . . . . . . 311
users, chatting with other . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 309
users, listing activity of online . . . . . . . . . . . . . . . . . . . . . . . . 305
users, listing those online . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 307
users, listing what they are doing . . . . . . . . . . . . . . . . . . . . . . . 24
users, listing when they last logged in . . . . . . . . . . . . . . . . . . 24
users, listing which are on . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
using a list of regexps to match from . . . . . . . . . . . . . . . . . . 152
using DOS and Windows disks . . . . . . . . . . . . . . . . . . . . . . . 245
using Macintosh disks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 246
V
validating an HTML file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 296
variables, shell . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
verifying an email address . . . . . . . . . . . . . . . . . . . . . . . . . . . . 281
versions, latest edition, and errata . . . . . . . . . . . . . . . . . . . . . . . 4
Vi . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33, 107
Vi, running a tutorial . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114
Vibro-Champ effect, adding to a sound file . . . . . . . . . . . . 228
video modes, switching between . . . . . . . . . . . . . . . . . . . . . . . 54
video tape labels, PostScript template for . . . . . . . . . . . . . . 173
viewing a character chart . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104
viewing a files revision log . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96
viewing a mail folder . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 279
viewing a site that requires authorization . . . . . . . . . . . . . . 289
viewing an image from the Web. . . . . . . . . . . . . . . . . . . . . . . 288
viewing an image in a Web browser . . . . . . . . . . . . . . . . . . . 187
viewing an image in X . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 184
viewing images . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 183
viewing text . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99
viewing your command history . . . . . . . . . . . . . . . . . . . . . . . . 40
virtual consoles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
virtual desktop . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
visual image directory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 186
volume level, changing the . . . . . . . . . . . . . . . . . . . . . . . . . . . 214
volume of a sound file, changing . . . . . . . . . . . . . . . . . . . . . . 226
volume, adjusting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 213
Vuksan, Vladimir . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 269
W
Walker, Andrew . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12, 128
Walker, Andy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
Web browser, viewing an image in a . . . . . . . . . . . . . . . . . . 187
Web browsers and tools, more . . . . . . . . . . . . . . . . . . . . . . . . 296
Web browsing, with Mozilla . . . . . . . . . . . . . . . . . . . . . . . . . . 285
Web page, reading the headers of a . . . . . . . . . . . . . . . . . . . . 294
Web pages, matching lines in . . . . . . . . . . . . . . . . . . . . . . . . . 153
Web resources, for Linux . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 321
Web site, archiving an entire . . . . . . . . . . . . . . . . . . . . . . . . . . 293
Web site, archiving part of a . . . . . . . . . . . . . . . . . . . . . . . . . . 293
Web site, mirroring an entire . . . . . . . . . . . . . . . . . . . . . . . . . . 293
Web sites, maintaining a history list of . . . . . . . . . . . . . . . . 286
Web, browsing in Emacs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 290
Web, getting files from the . . . . . . . . . . . . . . . . . . . . . . . . . . . . 292
Web, perusing text from the . . . . . . . . . . . . . . . . . . . . . . . . . . 289
Web, reading text from the. . . . . . . . . . . . . . . . . . . . . . . . . . . . 288
Web, viewing an image from the . . . . . . . . . . . . . . . . . . . . . . 288
what every Linux user knows . . . . . . . . . . . . . . . . . . . . . . . . . . 17
what to try first. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
what version of Debian am I running? . . . . . . . . . . . . . . . . . 320
what version of Linux am I running? . . . . . . . . . . . . . . . . . . 319
whats Debian? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
Whats Debian? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
whats free software? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
whats Linux? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
whats Open Source? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
whats Unix? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
wildcards . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
Winamp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 217
window attributes, specifying additional . . . . . . . . . . . . . . . . 52
window border . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47, 52
window colors, specifying . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
window font, specifying . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
window geometry . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
window manager . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
window managers, choosing . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
window outline . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
window size and location, specifying . . . . . . . . . . . . . . . . . . . 50
Windows disk, using . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 245
windows, deiconifying . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
windows, destroying . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
windows, iconifying . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
windows, manipulating . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
windows, maximizing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
windows, minimizing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
windows, moving . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
windows, resizing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
windows, sticky . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
wizard, defined . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
word lists and reference files . . . . . . . . . . . . . . . . . . . . . . . . . . 130
word lists, for spelling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122
word processing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 157
word processors and typesetting systems, other . . . . . . . . 173
word search, in Emacs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 154
Word, converting to LaTeX . . . . . . . . . . . . . . . . . . . . . . . . . . . 249
Word, converting to plain text . . . . . . . . . . . . . . . . . . . . . . . . . 249
word, finding the correct spelling of a . . . . . . . . . . . . . . . . . 121
word, listing the antonyms of a . . . . . . . . . . . . . . . . . . . . . . . 127
word, listing the definitions of a . . . . . . . . . . . . . . . . . . . . . . . 126
word, listing the hypernyms of a . . . . . . . . . . . . . . . . . . . . . . 127
word, listing the synonyms of a . . . . . . . . . . . . . . . . . . . . . . . 126
word, searching for a . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 147
WordNet lexical database . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125
words, counting in a text . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133
words, listing that match a pattern . . . . . . . . . . . . . . . . . . . . . 126
workbench . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
working with linux . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
working with selections from sound files . . . . . . . . . . . . . . 225
X
X client. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
X clients, manipulating windows of . . . . . . . . . . . . . . . . . . . . 52
X clients, running automatically. . . . . . . . . . . . . . . . . . . . . . . . 55
X font name . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 175
X font name, selecting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 176
X font, displaying the characters in an . . . . . . . . . . . . . . . . . 177
X fonts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 175
X fonts, listing available . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 176
X selection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115, 176
X server . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
X Window Dump files, viewing . . . . . . . . . . . . . . . . . . . . . . . 188
X Window System . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
X, configuring . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
X, starting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
X, stopping . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
XEmacs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 283
XMMS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 217
xterm font, resizing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 177
Xterm window, printing the contents of an . . . . . . . . . . . . . 240
XWave . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 230
Y
yanking text . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115
Z
Zawinski, Jamie . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 137, 173
Zicq. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 312
zombie process . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
Short Contents
Preface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
PART ONE: Working with Linux . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
1
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
2
What Every Linux User Knows . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
3
The Shell . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
4
The X Window System . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
PART TWO: Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
5
Files and Directories . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
6
Sharing Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
7
Finding Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81
8
Managing Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89
PART THREE: Text . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97
9
Viewing Text . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99
10 Text Editing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107
11 Grammar and Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121
12 Analyzing Text . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133
13 Formatting Text . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 139
14 Searching Text . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 147
15 Typesetting and Word Processing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 157
16 Fonts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 175
PART FOUR: Images . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 181
17 Viewing Images . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 183
18 Editing Images . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 189
19 Importing Images . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 201
20 PostScript . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 205
PART FIVE: Sound . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 211
21 Sound Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 213
22 Audio Compact Discs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 219
23 Editing Sound Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 225
PART SIX: Productivity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 231
24 Disk Storage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 233
25 Printing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 237
26 Cross-Platform Conversions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 245
27 Reminders . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 251
28 Mathematics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 261
PART SEVEN: Networking . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 267
269
275
285
299
315
321
323
327
333
Table of Contents
Preface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
Format of Recipes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
Assumptions, Scope, and Exclusions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
Typographical Conventions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
Versions, Latest Edition, and Errata . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
1.1
1.2
1.3
2.4
2.5
2.6
2.7
2.8
The Shell . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
3.1
3.2
3.3
3.4
3.5
3.6
4.3
4.4
4.5
4.6
Running X. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
4.1.1 Starting X. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
4.1.2 Stopping X . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
Running a Program in X . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
4.2.1 Specifying Window Size and Location . . . . . . . . . . . . . . . . . . . . 50
4.2.2 Specifying Window Colors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
4.2.3 Specifying Window Font . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
4.2.4 Specifying Additional Window Attributes . . . . . . . . . . . . . . . . . 52
Manipulating X Client Windows . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
4.3.1 Moving a Window. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
4.3.2 Resizing a Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
4.3.3 Destroying a Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
4.3.4 Minimizing a Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
4.3.5 Maximizing a Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
Moving around the Desktop . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
Running a Shell in X . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
Configuring X . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
4.6.1 Switching between Video Modes . . . . . . . . . . . . . . . . . . . . . . . . . . 54
4.6.2 Running X Clients Automatically . . . . . . . . . . . . . . . . . . . . . . . . . 55
4.6.3 Changing the Root Window Parameters . . . . . . . . . . . . . . . . . . . 55
4.6.4 Choosing a Window Manager . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
5.2
5.3
5.4
5.5
5.6
5.7
5.8
5.9
Sharing Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
6.1
6.2
6.3
Finding Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81
7.1
7.2
7.3
7.4
Managing Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89
8.1
8.2
8.3
8.4
8.5
8.6
8.7
Viewing Text . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99
9.1
9.2
9.3
9.4
Perusing Text . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99
9.1.1 Perusing a Text File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99
9.1.2 Perusing Multiple Text Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99
9.1.3 Commands Available While Perusing Text . . . . . . . . . . . . . . . 100
Outputting Text . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101
9.2.1 Showing Non-printing Characters . . . . . . . . . . . . . . . . . . . . . . . . 101
9.2.2 Outputting a Beginning Part of a Text . . . . . . . . . . . . . . . . . . . . 101
9.2.3 Outputting an Ending Part of a Text . . . . . . . . . . . . . . . . . . . . . . 102
9.2.4 Outputting a Middle Part of a Text . . . . . . . . . . . . . . . . . . . . . . . 102
9.2.5 Outputting the Text between Strings. . . . . . . . . . . . . . . . . . . . . . 103
9.2.6 Outputting Text in a Dialect . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103
Streaming Text . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103
Viewing a Character Chart . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104
10.3
10.4
10.5
10.6
10.7
11.2
11.3
11.4
Spelling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121
11.1.1 Finding the Correct Spelling of a Word. . . . . . . . . . . . . . . . . . 121
11.1.2 Listing the Misspellings in a Text . . . . . . . . . . . . . . . . . . . . . . . 121
11.1.3 Keeping a Spelling Word List. . . . . . . . . . . . . . . . . . . . . . . . . . . 122
11.1.4 Interactive Spell Checking . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122
11.1.5 Spell Checking in Emacs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 124
Dictionaries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125
11.2.1 Listing Words that Match a Pattern. . . . . . . . . . . . . . . . . . . . . . 126
11.2.2 Listing the Definitions of a Word . . . . . . . . . . . . . . . . . . . . . . . 126
11.2.3 Listing the Synonyms of a Word . . . . . . . . . . . . . . . . . . . . . . . . 126
11.2.4 Listing the Antonyms of a Word . . . . . . . . . . . . . . . . . . . . . . . . 127
11.2.5 Listing the Hypernyms of a Word . . . . . . . . . . . . . . . . . . . . . . . 127
11.2.6 Online Dictionaries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 127
Checking Grammar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 127
11.3.1 Checking Text for Misused Phrases . . . . . . . . . . . . . . . . . . . . . 128
11.3.2 Checking Text for Doubled Words . . . . . . . . . . . . . . . . . . . . . . 128
11.3.3 Checking Text for Readability . . . . . . . . . . . . . . . . . . . . . . . . . . 129
11.3.4 Checking Text for Difficult Sentences . . . . . . . . . . . . . . . . . . . 129
11.3.5 Checking Text for Long Sentences . . . . . . . . . . . . . . . . . . . . . . 129
Word Lists and Reference Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 130
12.2
12.3
12.4
12.5
12.6
13.2
13.3
13.4
13.5
13.6
14.3
14.4
14.5
14.6
14.7
15.3
15.4
15.5
15.6
16 Fonts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 175
16.1
16.2
16.3
16.4
X Fonts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 175
16.1.1 Selecting an X Font Name . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 176
16.1.2 Listing Available X Fonts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 176
16.1.3 Displaying the Characters in an X Font. . . . . . . . . . . . . . . . . . 177
16.1.4 Resizing the Xterm Font . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 177
Console Fonts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 177
16.2.1 Setting the Console Font . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 177
16.2.2 Displaying the Characters in a Console Font . . . . . . . . . . . . . 177
Text Fonts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 178
16.3.1 Horizontal Text Fonts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 178
16.3.2 Making a Text Banner . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 178
Other Font Tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 179
17.2
17.3
17.4
17.5
17.6
18.2
18.3
18.4
19.3
20 PostScript . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 205
20.1
20.2
20.3
205
205
206
207
207
207
208
208
208
209
209
209
21.3
21.4
21.5
22.2
22.3
22.4
Controlling CD Audio . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
22.1.1 Playing an Audio CD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
22.1.2 Pausing an Audio CD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
22.1.3 Stopping an Audio CD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
22.1.4 Shuffling Audio CD Tracks . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
22.1.5 Displaying Information about an Audio CD . . . . . . . . . . . . .
22.1.6 Ejecting an Audio CD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Sampling Sound from a CD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Writing an Audio CD-R. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Other Audio CD Applications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
219
219
219
220
220
220
221
221
222
223
23.2
23.3
23.4
24.4
25 Printing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 237
25.1
25.2
25.3
26.2
26.3
26.4
27 Reminders . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 251
27.1
27.2
27.3
27.4
27.5
27.6
28 Mathematics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 261
28.1
28.2
28.3
28.4
28.5
28.6
29.3
30 Email . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 275
30.1
30.2
30.3
30.4
30.5
30.6
31.2
31.3
31.4
31.5
31.6
31.7
32.5
32.6
Appendix A
A.1
A.2
A.3
A.4
Appendix B
Appendix C
License . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 323
C.1
C.2