Overview

Many people use nothing but GUI tools for manipulating files, launching programs, and so on. This approach certainly has its merits—GUI tools tend to be easy to learn, and they fit the needs of some tasks, such as graphics programs, very well. There is an older method of interacting with computers, though, which still has advantages: text-based shells. They are programs that accept typed commands and respond to these commands by launching programs or performing actions. Linux supports many text-based shells, and knowing how to select a shell and use it to its fullest can help you work with Linux. Shells work even when GUI tools are unavailable. They provide some features that are difficult for GUI equivalents to match—for example, the ability to operate on a collection of files that meet some arbitrary naming convention (say, all files whose names begin with A or Q and that end in .txt).

Shells are also extremely important because they're the basis for shell scripts. These programs are written in a language that's provided by the shell. (Most shell-script constructs can be used directly on the command line, which can be a quick way to test them.) Shell scripts use many common programming features, but they provide particularly easy access to features that are of great interest for everyday computer use, such as launching external programs. You can use a shell script to tie together several simple programs to accomplish much more complex tasks than any of these programs could manage by itself. Ordinary users can create shell scripts to work on their own files, but they're also important for system administration. In fact, common Linux startup files are most often shell scripts. This makes these scripts easy to customize—if you know how to write and modify shell scripts.

Note Shells, and particularly shell scripting, are potentially quite complex subjects. For more information, consult your shell's man page or a book on your shell of choice, such as Newham and Rosenblatt's Learning the bash Shell (O'Reilly,

1998) or Kochan and Wood's UNIX Shell Programming, Revised Edition (Sams, 1989).

Team LIB

Team LIB

^ previous

0 0

Post a comment