Introduction


Among key Linux features, the command-line shell is one of the most important. If you run a Linux server, your main interface is more than likely going to be the shell. If you're a power user running Linux on the desktop, you probably have a terminal open at all times. If you're a Linux newbie, you may think that you'll never open up the command line, but you will sometime ... and the more you use Linux, the more you're going to want to use that shell.

The shell in many ways is the key to Linux's power and elegance. You can do things with the command line that you simply can't do with whatever GUI you favor. No matter how powerful KDE or GNOME may be (or IceWM or XFCE or any of the other kajillion windowing environments out there), you will always be able to do many things faster and more efficiently with a terminal. If you want to master Linux, you need to begin by mastering the Linux command line.

The traditional method has been to use the Linux man pages. While man pages are useful, they are often not enough, for one simple reason: They lack examples. Oh, a few man pages here and there have a few examples, but by and large, examples are hard to come by. This presents a real problem for users at all experience levels: It's one thing to see options listed and explained, but it's another thing entirely to see those options used in real world situations.

This book is all about those missing examples. I've been using Linux for over a decade and I consider myself pretty knowledgeable about my favorite operating system. On top of that, I'm so addicted to the command line that I have KDE set up to automatically start Konsole, the KDE terminal, when I log in. But I'm always lamenting with other Linux users the dearth of examples found in man pages. When I was asked to write Linux Phrasebook, and told that it was to consist of hundreds of examples illustrating the most important Linux commands, I replied, "I can't wait! That's a book I'd buy in a heartbeat!"

You're holding the result in your hands: a book about the Linux commands you just have to know, with examples illustrating how to use each and every one. This is a reference book that will be useful now and for years to come, but I also hope you find it enjoyable as well, and even a little fun.

Audience for This Book

I've written this book to be useful both to beginnersthe folks that show up to meetings of our Linux Users Group seeking guidance and a helping hand as they begin the adventure of using Linuxand to experienced users who use the shell for everything from systems administration to games to programming. If you've just started using Linux, this book will help teach you about the shell and its power; if you've been using Linux for years and years, Linux Phrasebook will still teach you some new tricks and remind you of some features you'd long ago forgotten.

There are many shells out therecsh, tcsh, zsh, to name but a fewbut I use the default shell for virtually every Linux distro: bash, the Bourne Again Shell. The bash shell is not only ubiquitous, but also amazingly powerful and flexible. After you get comfortable with bash, you may choose to explore other options, but knowledge of bash is required in the world of Linux.

I wrote this book using K/Ubuntu, but the commands discussed should work on your distro as well. The only major difference comes when you run a command as root. Instead of logging in as root, K/Ubuntu encourages the use of the sudo command; in other words, instead of running lsof firefox as root, a K/Ubuntu user would run sudo lsof firefox.

In order to appeal to the widest number of readers out there, I showed the commands as though you have to run them as root, without sudo. If you see a # in front of a command, that's the shell indicating that root is logged in, which means you need to be root to run that command, or utilize sudo if you're using K/Ubuntu or a similar distro.

Conventions Used in This book

This book uses the following conventions.

  • Monospace type is used to differentiate between code/programming-related terms and regular English, and to indicate text that should appear on your screen. For example:

    The df command shows results in kilobytes by default, but it's usually easier to comprehend if you instead use the -h (or --human-readable) option.

    It will look like this to mimic the way text looks on your screen. 

  • An arrow () at the beginning of a line of code means that a single line of code is too long to fit on the printed page. It signifies to readers that the author meant for the continued code to appear on the same line. Many of the code examples in this book have been truncated due to length.

  • In addition to this, the following elements are used to introduce other pertinent information used in this book.

A Note presents interesting pieces of information related to the surrounding discussion.


A Tip offers advice or teaches an easier way to do something.


A Caution advises you about potential problems and helps you steer clear of disaster.




Linux Phrasebook
Linux Phrasebook
ISBN: 0672328380
EAN: 2147483647
Year: 2007
Pages: 288

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net