The Top Ten Concepts for Linux Beginners – Number 7, Shells and Utilities

linux73 The Top Ten Concepts for Linux Beginners   Number 7, Shells and Utilities
Levi Reiss asked:


A shell is the command interpreter program that serves as an interface between some users and the operating system itself. We say some users because most users rely on the graphical user interface. The Windows shell is the DOS command line interface accessed by clicking on Run and then entering the cmd command. The Windows graphical user interface is Explorer. This article describes the Damn Small Linux shell interface and several utilities, useful programs that may be launched from the shell. A subsequent article will describe the corresponding graphical user interface.

Why would anyone want to bother with a shell when the prettier, easier-to-learn and easier-to-use graphical interface is available? The answer is: It depends who you are and what you want to do. For system administrators or their associates it’s often much less cumbersome to use the shell rather than the graphical user interface. While Damn Small Linux commands may be quite arcane, they can be very powerful. And efficient. The Linux tools for performing administrative and other technical tasks admittedly take time to learn and master. But it does the job and does it well. In all fairness, many Windows systems administrators often apply command-line utilities. But they don’t have a powerful shell to help them do their work.

Historically Unix used the Bourne shell, the C shell based on the C programming language, and the Korn shell. Linux’s most widely used shell is Bash, also spelled BASH, the (Bourne-Again Shell). Damn Small Linux offers many shells but most people go with Bash both to communicate interactively with the operating system and to write programs known as shell scripts. If you program in Linux no matter which programming language you use you should learn some Bash specifics.

Utilities enable you to handle some very sophisticated processing. You can think of them as commands or as prewritten programs. Unix-Linux people often send the output of one command or utility to another command or utility for further processing. For example, the ps command displays active processes. It tends to generate voluminous output, especially in a busy system. Let’s say that you are interested only in the processes associated with a given terminal. You send (the technical term is pipe, expressed by the | character) the output of the ps command to the grep utility which looks for patterns within the input. You code a single line, multipart command to obtain the list of processes associated with that particular terminal. Unix and Linux are well known for elegant solutions. In contrast the Windows solution to this information need is much more clumsy.

The grep utility has many other uses including validating e-mail addresses. Let’s say that your web site asks potential subscribers to furnish their e-mail accounts when signing up for a newsletter. A sophisticated but relatively short statement coded in grep could validate e-mail accounts.

Other Damn Small Linux text processing utilities include the related egrep and fgrep commands, mawk a pattern scanning and text processing language, sed an editor that handles large files, and diff a utility that compares files. DSL provides utilities that compress and archive files, and a wide range of other utilities. If you need them, these Linux utilities can be quite useful and time-saving.

Our next subject is Linux programming support.


Random Posts

bookmark bookmark bookmark bookmark bookmark bookmark bookmark bookmark bookmark bookmark bookmark bookmark
tabs-top


No Comments »

No comments yet.

RSS feed for comments on this post. TrackBack URL

Leave a comment