I want to thank the following people who helped make this book possible.
First, the people who inspired me: Jenny Watson, Acquisitions Editor at Wiley Publishing, originally suggested that I write a shell-scripting book. Though Wiley didnt accept my proposal, it became the basis of this book. John C. Dvorak, noted columnist and pundit, gave great advice. In an episode of his video podcast, Cranky Geeks, Mr. Dvorak described the process of writing: Hell. Write 200 words a day and in a year, you have a novel. This tip led me to write a page a day until I had a book. Dmitri Popov wrote an article in Free Software Magazine titled Creating a book template with Writer, which inspired me to use OpenOffice.org Writer for composing the text. As it turned out, it worked wonderfully.
Next, the volunteers who helped me produce the original, freely distributable version of this book (available at LinuxCommand.org): Mark Polesky performed an extraordinary review and test of the text. Jesse Becker, Tomasz Chrzczonowicz, Michael Levin, and Spence Miner also tested and reviewed portions of the text. Karen M. Shotts contributed a lot of hours editing my original manuscript.
Next, the good folks at No Starch Press who worked long and hard making the commercial version of my book: Serena Yang, Production Manager; Keith Fancher, my editor; and the rest of the No Starch Press staff.
And lastly, the readers of LinuxCommand.org, who have sent me so many kind emails. Their encouragement gave me the idea that I was really on to something!
Introduction
I want to tell you a story. No, not the story of how, in 1991, Linus Torvalds wrote the first version of the Linux kernel. You can read that story in lots of Linux books. Nor am I going to tell you the story of how, some years earlier, Richard Stallman began the GNU Project to create a free Unix-like operating system. Thats an important story too, but most other Linux books have that one, as well. No, I want to tell you the story of how you can take back control of your computer.
When I began working with computers as a college student in the late 1970s, there was a revolution going on. The invention of the microprocessor had made it possible for ordinary people like you and me to actually own a computer. Its hard for many people today to imagine what the world was like when only big business and big government ran all the computers. Lets just say you couldnt get much done.
Today, the world is very different. Computers are everywhere, from tiny wristwatches to giant data centers to everything in between. In addition to ubiquitous computers, we also have a ubiquitous network connecting them together. This has created a wondrous new age of personal empowerment and creative freedom, but over the last couple of decades something else has been happening. A single giant corporation has been imposing its control over most of the worlds computers and deciding what you can and cannot do with them. Fortunately, people from all over the world are doing something about it. They are fighting to maintain control of their computers by writing their own software. They are building Linux.
Many people speak of freedom with regard to Linux, but I dont think most people know what this freedom really means. Freedom is the power to decide what your computer does, and the only way to have this freedom is to know what your computer is doing. Freedom is a computer that is without secrets, one where everything can be known if you care enough to find out.
Why Use the Command Line?
Have you ever noticed in the movies when the super hackeryou know, the guy who can break into the ultra-secure military computer in under 30 secondssits down at the computer, he never touches a mouse? Its because movie makers realize that we, as human beings, instinctively know the only way to really get anything done on a computer is by typing on a keyboard.
Most computer users today are familiar with only the graphical user interface (GUI) and have been taught by vendors and pundits that the command line interface (CLI) is a terrifying thing of the past. This is unfortunate, because a good command line interface is a marvelously expressive way of communicating with a computer in much the same way the written word is for human beings. Its been said that graphical user interfaces make easy tasks easy, while command line interfaces make difficult tasks possible, and this is still very true today.
Since Linux is modeled after the Unix family of operating systems, it shares the same rich heritage of command line tools as Unix. Unix came into prominence during the early 1980s (although it was first developed a decade earlier), before the widespread adoption of the graphical user interface and, as a result, developed an extensive command line interface instead. In fact, one of the strongest reasons early adopters of Linux chose it over, say, Windows NT was the powerful command line interface, which made the difficult tasks possible.
What This Book Is About
This book is a broad overview of living on the Linux command line. Unlike some books that concentrate on just a single program, such as the shell program, bash
, this book will try to convey how to get along with the command line interface in a larger sense. How does it all work? What can it do? Whats the best way to use it?
This is not a book about Linux system administration . While any serious discussion of the command line will invariably lead to system administration topics, this book touches on only a few administration issues. It will, however, prepare the reader for additional study by providing a solid foundation in the use of the command line, an essential tool for any serious system administration task.
This book is very Linux-centric . Many other books try to broaden their appeal by including other platforms, such as generic Unix and Mac OS X. In doing so, they water down their content to feature only general topics. This book, on the other hand, covers only contemporary Linux distributions. Ninety-five percent of the content is useful for users of other Unix-like systems, but this book is highly targeted at the modern Linux command line user.
Who Should Read This Book
This book is for new Linux users who have migrated from other platforms. Most likely you are a power user of some version of Microsoft Windows. Perhaps your boss has told you to administer a Linux server, or maybe youre just a desktop user who is tired of all the security problems and want to give Linux a try. Thats fine. All are welcome here.