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.
Read more: http://www.articlesbase.com/computers-articles/the-top-ten-concepts-for-linux-beginners-number-7-shells-and-utilities-640317.html#ixzz1ALHGRNpc
Under Creative Commons License: Attribution
vineri, 7 ianuarie 2011
The Top Ten Concepts for Linux Beginners - Number 7, Shells and Utilities
The Linux Command Line Shell Roundup
The command line is a powerful way to interact with a Linux computer. Instead of using the mouse, you just type commands into the shell. (The shell is a blank window where you type in your commands.) So for example, instead of clicking on your file browser, you simply type ls [enter] to display the contents of your working directory.
There are several different shells. The original shell is sh, or the Bourne Shell. It was developed by Stephen Bourne at Bell Laboratories. It's still in use today. Check for it in your /bin directory.
The C Shell, or csh, created at the University of California, Berkeley, has a different command language than sh. A lot of csh commands won't work in an sh shell and vice versa. And for some time, the only shell options were sh and csh.
The csh shell was created for Linux/Unix nerds who coded in the C programming language and wanted a shell that used a similar language. So csh was born. And so these two shells created a bit of a rift in Linux land. Sort of like the Ford/Chevy debate. Linux users love to argue about which tool is better.
Well, there are always options with Linux. So it wasn't long before other shells came about.
The tcsh shell is csh compatible, but has a bunch more nerdy features like auto-spelling correction, scheduling the time when you want to execute a command, and command line editing. This all sounds great, but for some reason, tcsh didn't catch on.
The korn shell, created by David Korn is sh compatible, but had a bunch of C shell features. The korn shell is sort of the best of sh and tcsh in one package. It is the default shell on some distros.
The bash shell (Bourne again shell) was created by the FSF (Free Software Foundation and the GNU Project). Bash is fully sh compatible and has many csh features as well. Bash comes default on many distros as well.
The Z shell, or zsh, developed by Paul Falstad has become quite popular, especially among Linux users. It is similar to ksh and sh both in syntax and function, and it is partially compatible with csh.
So there it is, the shell roundup. Currently, Ubuntu has bash as its default. The main thing is to test them out and see which one you like, or is most compatible with your needs.
Read more: http://www.articlesbase.com/operating-systems-articles/the-linux-command-line-shell-roundup-2713280.html#ixzz1ALGfxSin
Under Creative Commons License: Attribution