home account info subscribe login search My ITKnowledge FAQ/help site map contact us


 
Brief Full
 Advanced
      Search
 Search Tips
To access the contents, click the chapter and section titles.

Complete Idiot's Guide to Linux
(Publisher: Macmillan Computer Publishing)
Author(s): Manuel Ricart
ISBN: 078971826x
Publication Date: 12/22/98

Bookmark It

Search this book:
 
Previous Table of Contents Next


Part 2
Working on the Command Line

Now that wasn’t so bad was it? As you saw in Part 1, KDE helps make using Linux a breeze. But maybe you’re thinking to yourself, “What did users do before KDE?” or “What if I’m just a rebel and I want to see the nuts and bolts of Linux?” We’ve got you covered! Part 2 shows you Linux features without the glitz of KDE—you get to try your hand at working on the command line. The chapters in this section talk about consoles, getting help, and shells (sorry, not the kind you find on the beach—it’s not that kind of adventure). We even take a peek in the command toolbox at some useful shell commands and shortcuts. Well, if you’re ready, the command line awaits!

Chapter 11
Shells and Consoles

In This Chapter

  Introduction to the UNIX shell
  Basic shell navigation commands

Throughout the previous chapters I have focused on using Linux by using a graphical user interface (GUI or UI for short). If you use your computer as a workstation, that is how you’ll use it most of the time. However, that is only half the story. Although KDE’s ergonomics are nice, they are not yet as polished as the graphical environment available to Windows or Macintosh users; but it is an excellent start.

At this point, you know how to work under Linux using KDE. And while the tour was not really technologically driven, I hope you feel confident enough to do quite a few things without the command line.

In this section of the book, I will tell you how to work on Linux (and UNIX!) using a command line. No matter how much you want to stay away from the command line, the truth is that this evil interface is actually quite powerful, and in certain ways it is indispensable. (Of course, the shell’s interface isn’t really evil; it just isn’t as intuitive as a graphical environment such as KDE.) When you learn how to use a shell, you will have a powerful tool in your bag of tricks. Let’s get our hands dirty for the first time using a shell.

The UNIX Command Prompt

The UNIX command prompt, or shell, as it’s also called, provides you with direct access to the operating system. It is a command interpreter: It interprets and executes all of your commands. The shell is really just another program that sits between your keyboard, the operating system, and other programs. Unlike DOS, the shell is a separate program from the operating system, or kernel.

Though powerful, shells are lacking in the ergonomics department: They just don’t provide a friendly and intuitive GUI. And no matter how ergonomic the shell, the fact remains it is a shell, and it wants you to type in commands.

Yes, shells are by nature arcane and typing intensive, but they also are powerful. Shells provide many options unavailable to GUI-only systems. When you learn how to use a shell, you won’t be able to do without one! Granted, most things are easier to do with a GUI application, but many other things are not. The shell is then the right interface for certain kinds of problems.

If you are accessing an UNIX box remotely, you will more than likely do so through a shell interface. Shells come in different flavors and knowing how to use a shell is a good thing. It is a wise person who is familiar with at least two different shells. It will be of tremendous help if you ever have shell access to a system that doesn’t sport your favorite shell.

Most shells in UNIX are programmable, so if you find yourself writing the same commands over and over, it is easy to create a shell program (similar to a .bat file in DOS and Windows) that automates those commands for you. But you can worry about this when the time comes.

Shells are accessible through a terminal program. In KDE, there’s an application that provides you with shell access from within the graphic environment. This useful program is called kvt.

Shells are also accessible through a terminal program or a console. Remember when Linux first booted? It had a text interface. That’s the console. Linux also provides virtual consoles, which are discussed later in this chapter.

Shell Flavors

There are many shells to choose from. Why? Because people like to do things in different ways, and a number of programmers created new shells to solve some deficiency in a shell they liked. The list shown here is really a multi-species shell evolution tree. The first shell (sh) features have cross-pollinated, helping feature evolution:

  sh—In the beginning, this was your only choice. It’s called the Bourne shell. Unfortunately it doesn’t offer things that you really want in a shell, such as command-line editing.
  ksh—The Korn shell. This is a very popular UNIX shell. In the old days, this shell was only available if you had a specific brand of UNIX installed.
  csh—The C shell. This shell is similar to the other two when it comes to interactive use (typing on the screen) but very different in its programming grammar. The C shell was the first shell to provide job control (a way to manage running commands) and command history.
  tcsh—The tcsh is an enhanced C shell (csh). This shell is similar to the csh but offers command and filename completion and some command-line editing features.
  bash—This is the default shell in most Linux distribution. It is called the “Bourne Again Shell,” and it is created and distributed by the Free Software Foundation (GNU). It is a very good shell to learn; it has command-line editing and filename completion, and it is compatible with the original Bourne shell.
  zsh—This is the newest of all the shells. It is compatible with the Bourne shell.


Check This Out:  
Most shells provide a programming language of their own. Many programs that you run under Linux are actually shell scripts written for one of the shells presented here or for other command interpreters, such as Perl and Python.


Previous Table of Contents Next


Products |  Contact Us |  About Us |  Privacy  |  Ad Info  |  Home

Use of this site is subject to certain Terms & Conditions, Copyright © 1996-2000 EarthWeb Inc.
All rights reserved. Reproduction whole or in part in any form or medium without express written permission of EarthWeb is prohibited. Read EarthWeb's privacy statement.