Techno World Inc - The Best Technical Encyclopedia Online!

THE TECHNO CLUB [ TECHNOWORLDINC.COM ] => Others => Topic started by: Taruna on January 03, 2007, 01:41:43 PM



Title: Shell Introduction
Post by: Taruna on January 03, 2007, 01:41:43 PM
Hi all!
In previous two articles we discuss overview of computer system and brief introduction to operating system in user point of view.
In this article we discuss command based shell (bash).

Nowadays use of Desktop systems became common. So There is no need to enter any command, just by clicking with mouse we can accomplish any task. But command based shell has its own advantage. Work can be done fastly if we are comfortable with shell.

To experiment with shell. Run any of the programs like konsole, xterm,gnome-terminal,rxvt in KDE or GNOME desktop system or click <ctrl><alt><F1> to get virtual console. Terminal and console has same meaning.

Now we get command prompt. Now to know the commands starting with a type
$ a <tab>
Now we will see all commands starting with a . To know what is the functionality or usage of any command in the given list. Try the following
$ man <command> or
$ info <command> or
$ <command> -h or
$ <command --help

For example to list the contents of the current directory
enter
$ ls

To see the contents of some directory x
enter

$ ls x
bash shell has feature command name completion and file name completion. It means there is no need to enter full command or filename, after entering something if we press <tab> shell automatically completes.
For example to enter command fuser somefile.

$ fus<tab> some<tab>
it automatically completes to fuser somefile

You can use arrow keys to navigate through command history.

bash also contains command editing facilities.
<ctrl>u--erase the command from the cursor to the &nb sp; begin
<ctrl>k -- erase the command from the cursor to the end
<ctrl>l -- clear the screen
<ctrl>a -- move the cursor to the beginning of line
<ctrl>e -- move the cursor to the end of line
<ctrl>d -- exit the current session
<leftarrow>-- moves the cursor to left
<rightarrow>--moves the cursor to right
-- delete the character after cursor
<backspace>-- delete the character before cursor
<ctrl>r -- reverse search of history
<ctrl>s -- forward search of hostory
<ctrl>c -- cancel the execution of current command
<ctrl>z -- suspends the execution of current command

for more information see $man bash