| help | account  


A Practical Guide to Linux Commands, Editors, and Shell Programming
View Larger Image
Mark G. Sobell
Prentice Hall, Paperback, Published July 2005, 965 pages, ISBN 0131478230
List Price: $49.99
Our Price: $27.25
You Save: $22.74 (45% Off)


FREE Shipping on Orders over $40!*
Availability: In-Stock
Read an excerpt:
Chapter 5: The Shell

     

Excerpt provided courtesy of Prentice-Hall PTR. Copyright © Prentice-Hall PTR. Written permission from the publisher is required for any use of this material.

Customer Reviews: 1     Average Customer Rating:

Write a Review and tell the world about this title!

People who purchase this book frequently purchase:

Books on similar topics, in best-seller order:Books from the same publisher, in best-seller order:

The essential reference for core commands that Linux users need daily, along with superior tutorial on shell programming and much moreSystem administrators, software developers,  quality assurance engineers and others  working on a Linux system need to work from the command line in order to be effective.  Linux is famous for its huge number of command line utility programs, and the programs themselves are famous for their large numbers of options,  switches, and configuration files.  But the truth is that users will only use a limited (but still significant)  number of these utilities on a recurring basis, and then only with a subset of the most important and useful options, switches and configuration files.   This book cuts through all the noise and shows them which utilities are most useful, and which options most important.  And it contains examples, lot's and lot's of examples.  This is not just a reprint of the man pages.

And Linux is also famous for its "programmability."  Utilities are designed, by default, to work wtih other utilities within shell programs as a way of automating system tasks.  This book contains a superb introduction to Linux shell programming.  And since shell programmers need to write their programs in text editors, this book covers the two most popular ones: vi and emacs.

 

Preface

A Practical Guide to Linux Commands, Editors, and Shell Programming explains how to work with the Linux operating system from the command line. The first few chapters quickly bring readers with little computer experience up to speed. The rest of the book is appropriate for more experienced computer users. This book does not describe a particular release or distribution of Linux but rather pertains to all recent versions of Linux.

Command line interface (CLI). In the beginning there was the command line (textual) interface (CLI), which enabled you to give Linux commands from the command line. There was no mouse or icons to drag and drop. Some programs, such as emacs , implemented rudimentary windows using the very minimal graphics available in the ASCII character set. Reverse video helped separate areas of the screen. Linux was born and raised in this environment.

Naturally all of the original Linux tools were invoked from the command line. The real power of Linux still lies in this environment, which explains why many Linux professionals work exclusively from the command line. Using clear descriptions and lots of examples, this book shows you how to get the most out of your Linux system using the command line interface.

Linux distributions. A Linux distribution comprises the Linux kernel, utilities, and application programs. Many distributions are available, including Debian, Red Hat, Fedora Core, SUSE, Mandriva (formerly Mandrake), KNOPPIX, and Slackware. Although the distributions differ from one another in various ways, all of them rely on the Linux kernel, utilities, and applications. This book is based on the code that is common to most distributions. As a consequence you can use it regardless of which distribution you are running.

Overlap. If you read A Practical Guide to Red Hat Linux,Second Edition: Fedora Core and Red Hat Enterprise Linux, or a subsequent edition, you will notice some overlap between that book and the one you are reading now. The introduction, the appendix on regular expressions, and the chapters on the utilities (Chapter 3 of this book-- not Part V), the filesystem, and programming tools are very similar in the two books. The three chapters that cover the Bourne Again shell ( bash ) have been expanded and rewritten for this text. Chapters that appear in this book and but not in A Practical Guide to Red Hat Linux, Second Edition, include those covering the vim and emacs editors, the TC Shell ( tcsh ), the gawk and sed languages, and Part V, which describes 80 of the most useful Linux utility programs in detail.

Audience. This book is designed for a wide range of readers. It does not require programming experience, although some experience using a general-purpose computer is helpful. It is appropriate for the following readers:

  • Students taking a class in which they use Linux
  • Power users who want to explore the power of Linux from command line
  • Professionals who use Linux at work
  • System administrators who need a deeper understanding of Linux and the tools that are available to them
  • Computer science students who are studying the Linux operating system
  • Programmers who need to understand the Linux programming environment
  • Technical executives who want to get a grounding in Linux

Benefits. A Practical Guide to Linux Commands, Editors, and Shell Programming gives you an in-depth understanding of how to use Linux from the command line. Regardless of your background, it offers the knowledge you need to get on with your work: You will come away from this book understanding how to use Linux, and this text will remain a valuable reference for years to come.

 


Table of Contents

Preface.

1. Welcome to Linux.

    The GNU-Linux Connection

    The Heritage of Linux: UNIX

    What Is So Good About Linux?

    Overview of Linux

    Additional Features of Linux

    Chapter Summary

    Exercises

I. THE LINUX OPERATING SYSTEM.

2. Getting Started.

    Conventions Used in This Book

    Logging In

    Working with the Shell

    Curbing Your Power: Superuser Access

    Getting the Facts: Where to Find Documentation

    More About Logging In

    Chapter Summary

    Exercises

    Advanced Exercises

3. Command Line Utilities.

    Special Characters

    Basic Utilities

    Working with Files

    | (Pipe): Communicates Between Processes

    Four More Utilities

    Compressing and Archiving Files

    Locating Commands

    Obtaining User and System Information

    Communicating with Other Users

    Email

    Chapter Summary

    Exercises

    Advanced Exercises

4. The Linux Filesystem.

    The Hierarchical Filesystem

    Directory and Ordinary Files

    Working with Directories

    Access Permissions

    Links

    Chapter Summary

    Exercises

    Advanced Exercises

5. The Shell.

    The Command Line

    Standard Input and Standard Output

    Running a Program in the Background

    Filename Generation/Pathname Expansion

    Builtins

    Chapter Summary

    Exercises

    Advanced Exercises

II. THE EDITORS.

6. The vim Editor.

    History

    Tutorial: Creating and Editing a File with vim

    The compatible Parameter

    Introduction to vim Features

    Command Mode: Moving the Cursor

    Input Mode

    Command Mode: Deleting and Changing Text

    Searching and Substituting

    Miscellaneous Commands

    Yank, Put, and Delete Commands

    Reading and Writing Files

    Setting Parameters

    Advanced Editing Techniques

    Units of Measure

    Chapter Summary

    Exercises

    Advanced Exercises

7. The emacs Editor.

    History

    Tutorial: Getting Started with emacs

    Basic Editing Commands

    Online Help

    Advanced Editing

    Language-Sensitive Editing

    Customizing emacs

    More Information

    Chapter Summary

    Exercises

    Advanced Exercises

III. THE SHELLS.

8. The Bourne Again Shell.

    Background

    Shell Basics

    Parameters and Variables

    Processes

    History

    Aliases

    Functions

    Controlling bash Features and Options

    Processing the Command Line

    Chapter Summary

    Exercises

    Advanced Exercises

9. The TC Shell.

    Shell Scripts

    Entering and Leaving the TC Shell

    Features Common to the Bourne Again and TC Shells

    Redirecting Standard Error

    Working with the Command Line

    Variables

    Control Structures

    Builtins

    Chapter Summary

    Exercises

    Advanced Exercises

IV. PROGRAMMING TOOLS.

10. Programming Tools.

    Programming in C

    Using Shared Libraries

    make: Keeps a Set of Programs Current

    Debugging C Programs

    Threads

    System Calls

    Source Code Management

    Chapter Summary

    Exercises

    Advanced Exercises

11. Programming the Bourne Again Shell.

    Control Structures

    File Descriptors

    Parameters and Variables

    Builtin Commands

    Expressions

    Shell Programs

    Chapter Summary

    Exercises

    Advanced Exercises

12. The gawk Pattern Processing Language.

    Syntax

    Arguments

    Options

    Notes

    Language Basics

    Examples

    Advanced gawk Programming

    Error Messages

    Chapter Summary

    Exercises

    Advanced Exercises

13. The sed Editor.

    Syntax

    Arguments

    Options

    Editor Basics

    Examples

    Chapter Summary

    Exercises

    Part V: Command Reference

    Standard Multiplicative Suffixes

    Common Options

    The sample Utility

    sample: Very brief description of what the utility does

    aspell: Checks a file for spelling errors

    at: Executes commands at a specified time

    bzip2: Compresses or decompresses files

    cal: Displays a calendar

    cat: Joins and displays files

    cd: Changes to another working directory

    chgrp: Changes the group associated with a file

    chmod: Changes the access mode (permissions) of a file

    chown: Changes the owner of a file and/or the group the file is associated with

    cmp: Compares two files

    comm: Compares sorted files

    configure: Configures source code automatically

    cp: Copies files

    cpio: Creates an archive or restores files from an archive

    crontab: Maintains crontab files

    cut: Selects characters or fields from input lines

    date: Displays or sets the system time and date

    dd: Converts and copies a file

    df: Displays disk space usage

    diff: Displays the differences between two files

    du: Displays information on disk usage by file

    echo: Displays a message

    expr: Evaluates an expression

    file: Displays the classification of a file

    find: Finds files based on criteria

    finger: Displays information about users

    fmt: Formats text very simply

    fsck: Checks and repairs a filesystem

    ftp: Transfers files over a network

    gcc: Compiles C and C++ programs

    grep: Searches for a pattern in files

    gzip: Compresses or decompresses files

    head: Displays the beginning of a file

    kill: Terminates a process by PID

    killall: Terminates a process by name

    less: Displays text files, one screen at a time

    ln: Makes a link to a file

    lpr: Sends files to printers

    ls: Displays information about one or more files

    make: Keeps a set of programs current

    man: Displays documentation for commands

    mkdir: Creates a directory

    mkfs: Creates a filesystem on a device

    Mtools: Uses DOS-style commands on files and directories

    mv: Renames or moves a file

    nice: Changes the priority of a command

    nohup: Runs a command that keeps running after you log out

    od: Dumps the contents of a file

    paste: Joins corresponding lines from files

    pr: Paginates files for printing

    ps: Displays process status

    rcp: Copies one or more files to or from a remote system

    rlogin: Logs in on a remote system

    rm: Removes a file (deletes a link)

    rmdir:Removes a directory

    rsh: Executes commands on a remote system

    scp: Securely copies one or more files to or from a remote system

    sleep: Creates a process that sleeps for a specified interval

    sort: Sorts and/or merges files

    split: Divides a file in into sections

    ssh: Securely executes commands on a remote system

    strings: Displays strings of printable characters

    stty: Displays or sets terminal parameters

    tail: Displays the last part (tail) of a file

    tar: Stores or retrieves files to/from an archive file

    tee: Copies standard input to standard output and one or more files

    telnet: Connects to a remote system over a network

    test: Evaluates an expression

    top: Dynamically displays process status

    touch: Changes a file's access and/or modification time

    tr: Replaces specified characters

    tty: Displays the terminal pathname

    tune2fs: Changes parameters on an ext2 or ext3 filesystem

    umask: Establishes the file-creation permissions mask

    uniq: Displays unique lines

    w: Displays information about system users

    wc: Displays the number of lines, words, and bytes

    which: Shows where in PATH a command is located

    who: Displays information about logged-in users

    xargs: Converts standard input into command lines

VI. APPENDIXES.

Appendix A: Regular Expressions.

    Characters

    Delimiters

    Simple Strings

    Special Characters

    Rules

    Bracketing Expressions

    The Replacement String

    Extended Regular Expressions

    Appendix Summary

Appendix B: Help.

    Solving a Problem

    Finding Linux-Related Information

    Specifying a Terminal

Appendix C: Keeping the System Up-to-Date.

    yum: Updates and Installs Packages

    Apt: An Alternative to yum

    BitTorrent

Glossary.

Index.

 

About the Author

Mark G. Sobell is the author of three best-selling UNIX and Linux books: A Practical Guide to the UNIX System, UNIX System V: A Practical Guide, and A Practical Guide to Linux. He has more than twenty years of experience working with UNIX and Linux and is president of Sobell Associates Inc., a consulting firm that designs and builds custom software applications, designs and writes documentation, and provides UNIX and Linux training and support.


Customer Reviews

Customer Reviews: 1     Average Customer Rating:

Nov 14, 2005     Oblomov from Washington, DC
Best book on Linux coming from Windows World
I am new to Linux. I've played around with it for a bit 3-4 years back, but haven't looked at it since. Recently I've had to start managing a few Linux boxes, and even with a lot of information available online, it was not quite enough.

This book provided easy and indexed descriptions and examples needed to get into Linux (CentOS specifically) quick and get going. It has excellent shell descriptoins and command examples. It's a much more useful book then Running Linux or the Fedora Bible book I got.



Forgot your password?
FAQs
Shipping Options
Returns
Your Orders
Your Account